Copyright: VB Compress Help ® 1992-95 WhippleWare


VB Compress 3.11 Help

Copyright 1992-94 by WhippleWare

What's New in 3.11

Getting Started

Overview

Options

Windows

Menus & Commands

Troubleshooting

Technical Support

Q&A


VB Compress Options

VB Compress (VBC) has the ability to generate many different kinds of reports about your VB projects, and to optimize your code in many different ways.

After installing VBC, the only configuration change you really need to make before using it is to select Set Directories on the main window's File menu, and set the working directories so that VBC writes files where you want it to write files.  The default settings for the 60+ other options are just fine for getting started.

As you become more familiar with VBC's basic functions, however, you will probably want to take advantage of its flexibility and configure it to generate different reports and process your code in different ways.  You do so by selecting one of the three general groups of options also listed on the main window's File Menu:

Process options determine the way VBC processes your code.

Report options determine the kind of report VBC generates.

Program options determine general aspects of VBC's behavior.


VB Compress Windows

Assertion Statement Window

Consolidation Problem Window

Main Window

Process Options Window

Program Options Window

Report Options Window

Report Viewer Window

Reserved Word List Window

Set Default Data Type Window

Set Directory Window

Status Window

Substring Matching Parameter Window

VB Control Window

VB Error Window

Working Directories Window


VB Compress Menus & Commands

The Compress Menu

The File Menu

The Help Menu

The Viewer Menu

Main Window Commands

Process Options Commands

Program Options Commands

Report Options Commands

Reserved Word List Commands

Status Window Commands


VB Compress Overview

What's VB Compress?

It's our award-winning development tool, written by and for serious VB programmers, that integrates project analysis, cross-referencing, and optimization in a single package.  VB Compress (VBC) will save you time and money; help you write, manage, and maintain code better; and produce the smallest possible EXE's.

What does VB Compress do?

First, it analyzes your project from top to bottom and tells you exactly what's in it and how it's organized; what constants, variables,  type defs, API declarations, and procedures are defined; where they are defined; how they are scoped; where they are referenced; and most importantly, whether they are referenced at all.

Second, it creates an optimized copy of your code and generates a new EXE.  Original code is left intact, but the copy has only what is needed: no bloat from standard global and module files; no bloat from the redundant, unreferenced, and obsolete code that creeps in during development.  The code and the EXE are as tight as they can be.

What does VB Compress do for you?

By optimizing your code on the fly, VB Compress lets you have the best of both worlds: the code management and maintenance efficiency of standard globals and modules; but the EXE efficiency that can only be obtained with precise customization.  And you'll never cut and paste again.

See Also:

VB Compress In Action

The Processing Cycle

Examples

Use the API, Lose 60K without Cut & Paste

Add-on Code Shrinks by 66% and Stays Easy to Maintain

A Database App Loses 40K, Gets Better Organized and Understood


Example 1

Use the API, Lose 60K without Cut & Paste

One of the great things about VB is that it lets you keep the Win API at your fingertips: just include WIN30API and WIN31EXT in the auto-load file, and every constant, type def, and API function is ready to use.  Did cut and paste go out with VB1?

Only if you don't care about efficient EXE's.  Because VB/Win executables aren't compiled, items in header files like WIN30API take up space.  And VB still doesn't figure out which items in header files are actually used by your project.  It just includes them all.

To see the problem, start VB and make an executable for the blank Form1; it'll be 5K.  Load the Win API, make EXE again, and it'll be 65K, even though none of the API is used.  So unless you don't care about having 60K of junk in your EXE, you're back to cut and paste.

Unless you have VB Compress.  It'll read your code, construct a new header with only what is needed, and regenerate the EXE; in this case, it's back to 5K in a few seconds. So VB lets you keep the API at your fingertips, but only VB Compress lets you do so for free.

Example 2


Example 2

Add-on Code Shrinks by 66%, Stays Easy to Maintain

A popular VB/Win add-on includes 50 projects for demonstration and reuse.  Most use the standard global and one or more standard modules that the vendor uses for code management and maintenance efficiency.

VB Compress added the EXE efficiency of precise customization, shrinking the average EXE by 66%, far more than the shift from VB1 to VB2+.  A typical project didn't need 95/100 constants, 16/18 type defs, 330/336  DLL declarations, and 33/45 module procedures.  Without VB Compress, the unused bytes add up.

Example 3


Example 3

A Database App Loses 40K, Gets Better Organized

A customer was using VB/Win with Paradox.TM  The project had 30 forms and modules, a 500 line standard header for the database engine, large chunks of the Win API, and 20,000 lines of code.  The EXE was 325K.

VB Compress found a lot of fluff.  The database header declared 270 global constants and 100 DLL functions, but only 1/3 of each were referenced.  41 of 170 module routines were never called.  There were 350 lines of code in dead form-based procedures, orphaned when controls were  deleted.

Module consolidation revealed that parts of Win API were declared more than once; constants had module scope in some places, global in another.  And instructions to move API function declarations from forms to the global turned up more duplication; SendMessage(), for example, was declared 8 times.

The bottom line?  After manual attention to a few of the problems, a final pass by VB Compress shrank the EXE to 279K.  The code was better organized.  And the lead developer had a better understanding of what was going on behind VB/Win's pretty face.


Getting Started

 Thanks for trying VB Compress!

What do you need to do to get started?

Set the Project Directory to point to your code;

Select File/Set Directories and set the working directories .

Select a project and click Analyze or Compress.

What should you do before getting started?

Scan the overview;

Check out about documentation

Explore VBC's many options

If upgrading, check out what's new in 3.01 and 3.11

If you have non-English VB or Windows, check out the VB Control Interface.

A few minutes spent on these topics will be time well spent. Then crank up VB Compress and analyze and optimize!

Again, thank you for your business!

Ben Whipple

President & Programmer


Getting Started

 Thanks for trying VB Compress Pro!

What do you need to do to get started?

Set the Project Directory to point to your code;

Select File/Set Directories and set the working directories .

Select a project and click Analyze or Compress.

What should you do before getting started?

Scan the overview;

Check out about documentation

Explore VBC's many options

Check out what's new in 3.01 and 3.11

If you have non-English VB or Windows, check out the VB Control Interface.

A few minutes spent on these topics will be time well spent. Then crank up VB Compress Pro and analyze and optimize!

Again, thank you for your business!

Ben Whipple

President & Programmer


The Processing Cycle

What happens when you select a project name and click Compress?  This section tells you, in excruciating detail.

When you first select a project, VBC analyzes the project files and displays the information on the main window's project information list.  When you click Compress, the main window disappears, the Status Window pops up, and the processing cycle begins.

1) Ascii file conversion.  If any project files are stored in binary format, VBC calls VB and instructs it to copy or resave them in ASCII format.  During conversion, the status window shrinks into the lower left corner of the screen and reads "Resaving Files in ASCII Format."

2) Determination of optimized project files.  Actions depend on option settings as discussed in the Optimized Code files topic.  Status window returns to center of screen, status action reads "Creating File List."

3) Control identification.  VBC scans all form files, status action reads "Extracting Control Names."

4) Procedure identification.  VBC scans all form and module files, status action reads "Extracting procedure names."

5) Unreferenced form procedure identification.  Form by form, VBC :

1) loads all procedures

2) identifies all event procedures, and

3) searches code recursively to locate all procedure calls.

Status action cycles through "Loading", "Searching", and "Reading."  If Pro Version and substring matching is active, string literals are dumped to disk before each form is unloaded; status action reads "Extracting String Literals."

6) File header extraction.  VBC copies the declarations section of each project file into a temporary file.  Status action reads "Extracting file headers."  If Make 1 Global is on, consolidation error check is done, user is alerted if necessary, and if Make 1 Global remains set, globals are consolidated into a single file.

7) Report Initialization.  VBC now knows enough about the project to start the analysis file.  Status action reads "Initializing Report."

8) File Header Retrieval.  VBC reads all temporary header files, status action reads "Reading Headers."

9) Unreferenced module procedure identification.  VBC reads all module procs into memory and, beginning with those called from form procs, searches code recursively to locate all references.  As in step 5, status action cycles through "Loading", "Searching", and "Reading."  If Pro Version and substring matching is active, string literals are dumped to disk before each form is unloaded; status action reads "Extracting String Literals."

10) Module Consolidation Error Check.  If Make 1 Module is active, module files are tested for potential consolidation problems and user is alerted as necessary.  Status action reads "Testing module consolidation."

11) Module Consolidation.  If Make 1 Module is active, module code is combined into a single file.  Status action reads "Merging Module Headers" and "Merging Module Code."

12) Global Retrieval.  VBC reads all globals from the temp header files into memory.  Status action reads "Identifying Globals."

13) Optimization inner cycle, including identification and elimination of unreferenced Items and the writing of optimized code to disk.  For each form and module, VBC:

a) loads all procs into memory.  During load, unreferenced procs and, if Pro, debug statements are flagged or removed.  Blank lines and comments are discarded, if specified.  Status action reads "Loading."

b) examines each proc line by line for references to global, file, and procedure level identifiers.  If requested, proc level analysis report and local database is written.  Status action reads "Analyzing."

c) reloads and recurses file header, marking all referenced items.  Status actions cycles through "Loading", "Checking References" and "Checking Dependencies."

d) writes optimized file to disk, beginning with form definitions and binary data for Ascii forms, followed by headers and optimized procedures.  If Pro, substrings are aliased.  If requested,  form/module level analysis report is written.  Status action reads "Rewriting."

14) Final global write.  If Make 1 Global, optimized global is rewritten.  If neither Make 1 Global nor Make 1 Module is active, VBC checks for referenced globals not referenced at time parent files were rewritten, and rewrites again as necessary.  Status action reads "Rewriting Header."

15) Interaction with VB.  If requested, VBC starts VB and instructs it to perform requested actions.  Status Window shrinks to lower left corner of screen.

16) Report Consolidation.  VBC combines report header, file info and proc info as specified in Organization option.  Status action reads "Writing", then "Merging."

17)File Format Restoration.  If the Binary Project File option is set to Convert & Restore, VBC calls VB one last time and resaves converted files in their original binary format.

18) Complete (Whew!).  Status Window disappears.  VBC queries user about report and restores Main Window.


File Menu Commands

Process Options (Ctrl-P)

Open the Process Options Window.

Report Options (Ctrl-R)

Open the Report Options Window

Program Options (Ctrl-G)

Open the Program Options Window.

Set Directories (Ctrl-D)

Open the Working Directories Window

Reserved Words (Ctrl-W)

Open the Reserved Word List Window

Debug Statements (Ctrl-S) (Pro Only)

Open the Debug Statement List Window

EXIT (Ctrl-X)

Record current setttings and exit.


Compress Menu Commands

Compress <Project Name> (Ctrl-C)

Compress the current project.  This command is disabled until you select a project on the upper project list.  You may also initiate compression by double-clicking a project name, or by clicking the COMPRESS command button.

Compress All Projects (Batch Mode) (Ctrl-A)

Compress multiple projects in the current project directory, starting with the currently selected project and ending at the end of the list.  If  no project is selected, VBC will start with the first.  This command is disabled if the project directory contains one or fewer projects.

When you select Compress All, VBC operates in batch mode.  When operating in batch mode, some of the prompts that ordinarily appear are answered automatically.

If you use batch mode, be sure to see the discussions of Error Logging and the /NOSTOP command line switch.

Make EXE <Project Name> (Ctrl-K)

Start VB, generate a new executable for the project currently selected on either project list.

Text Save & Load <Project Name> (Ctrl-T)

Start VB, load the project currently selected on either project list, and perform save text / load text on all forms.  Not as useful as in VB1, but reports from the field indicate doing this can avoid fatal VB crash on Make EXE.

Binary / Ascii Save <Project Name> (Ctrl-B,Ctrl-I)

Start VB, load the project currently selected on either project list, and resave all form and module files in the desired format.

Start Visual Basic: (Ctrl-V)

Start Microsoft Visual Basic.  If a project is selected on either project list, VBC asks if you want to load it on startup.


Help Menu Commands

Contents

Open the help file at the contents topic.

Search Help

Open the help file for keyword searching

What is... (Shift-F1)

Context-sensitive help:  After selecting, click special cursor on the item for which you want help.

Tech Support

Open the help file at the Technical Support topic.

Using Help

Standard Windows Help on Help

About...

Display the VBC About Box


Main Window Commands

Analyze (Alt-A)

Analyze the current project and generate the report specified by the current settings of report options.

Compress (Alt-C)

Analyze and optimize the current project.

View Info (Alt-V)

Start report viewer and load currently selected analysis file.  Visible only when an optimized project or project report is selected on the VBC Report / Project list..

Help (Alt-E)

Context Sensitive Help:  After selecting, click special cursor on the item for which you want help.

Exit (Alt-X)

Save current configuration in the initialization file and exit VBC.

Note: The Analyze and  View Info commands share a command button; only one is visible at a time. See the VBC Report / Project list.. discussion for more information.


Process Options Commands

OK

Save Process Options changes and return to main window.

Cancel

Cancel Process Options changes and return to main window.

Help

Context -sensitive help:  After selecting, click special cursor on the item for which you want help.


Report Options Commands

OK

Save Report Options changes and return to main window

Cancel

Ignore configuration changes and return to main window

Help

Context-sensitive help: After selecting, click special cursor on the item for which you want help.

All

Configure report options for maximum information

None

Configure report options for minimal information: no report will be generated.


Program Options Commands

OK

Save Program Options changes and return to main window.

Cancel

Cancel Program Options changes and return to main window.

Help

Context -sensitive help:  After selecting, click special cursor on the item for which you want help.


Status Window Commands

Idle

Puts VBC in idle state.  Idle state allows you to interrupt a long-running process to do something else with your PC, but without losing the work already done.

When VBC is idling, the caption on this command changes to RESUME; click it again to end idle state.

When VBC is idling, you can minimize the window by clicking on the Action window.

Cancel

Terminate optimization of the current project.

Help

Get Help


Reserved Word List Commands

Add

Add the word in the edit box to the reserved word list; disabled when edit box is empty

Replace

Replace the currently selected word on the list with the word in the edit box; disabled when edit box is empty and/or no word is selected.

Delete

Delete the currently selected word on the list; disabled when no word is selected.

Find

Search the list for the word in the edit box; disabled when edit box is empty.

Confirm

When checked, you will be asked to confirm all changes.

OK

Save changes and exit list window.

Cancel

Ignore changes and exit list window.  Confirmation will be requested if changes have been made.

Help

Context-sensitive help: After selecting, click special cursor on the item for which you want help.

Reread

Rereads the specified file and refreshes the list.

See also:

The Reserved Word List


Debug Statement List Commands Pro Only
Debug Statement List Commands (Pro Only)

Add

Add the statement in the edit box to the statement list; disabled when edit box is empty

Replace

Replace the currently selected statement on the list with the statement in the edit box; disabled when edit box is empty and/or no statement is selected.

Delete

Delete the currently selected statement on the list; disabled when no statement is selected.

Find

Search the list for the statement in the edit box; disabled when edit box is empty.

Confirm

When checked, you will be asked to confirm all changes.

OK

Save changes and exit list window.

Cancel

Ignore changes and exit list window.  Confirmation will be requested if changes have been made.

Help

Context-sensitive help: After selecting, click special cursor on the item for which you want help.

Reread

Rereads the specified file and refreshes the list.

See Also:

Debug Statement Handling

Debug Statement List


Working Directory Window Commands

OK

Save directory changes and return to main window.

Cancel

Ignore directory changes and exit return to main window.

Help

Get Help on Working Directories


The VB Control Window

When the VB Control Window, pictured above, appears on the lower left corner of your screen, it indicates that VBC started VB under its own control but has gone to sleep and turned control over to you.  This occurs when VBC has finished processing a project and either:

a) The Interaction with VB option is set to Load Project, or

b) VB reports a problem trying to load or compile the optimized code and you click "Take Control of VB" on the VB Error Window.  In this situation, the "Make EXE" caption shown above will read "Retry EXE" instead.

The pseudo command buttons on the VB Control Window have the following effects:

Exit VB

VBC instructs VB to exit, but leaves to you the responses to any VB "Save Changes?" dialog boxes.

Exit w/o Save

VBC shuts down VB, responding NO to any VB "Save Changes?" dialog boxes.

Make EXE / Retry EXE

VBC instructs VB to compile the project.  If VB succeeds, and if Interaction with VB is set to Compile & Exit, VBC  shuts down VB and resumes execution.

HELP

Starts VBC help at this topic.


The New Project Directory

The New Project Directory is where VBC writes the optimized code files  it generates during execution.

The New Project Directory must be different than the Projects Directory so that VBC does not overwrite your original project files.


The Scratch Directory

The Scratch Directory is where VBC writes most of the temporary files it generates during execution.

The Scratch Directory must be different than the Projects Directory and the New Projects Directory, to eliminate the possibility of VBC overwriting your project files.

Note: While running, VBC creates up to 5 temporary files on the scratch drive for every file in the project it is optimizing.  If you are using a RAM disk for the scratch directory, you may therefore run out of file handles and get a "too many files" error even though there is plenty of space.  This is because the RAMDRIVE device driver defaults to 64 file handles unless you specify otherwise.  If you have this problem, see your DOS documentation for how to edit CONFIG.SYS to increase the number of file handles available.


The Report Directory

The directory where VBC will write its project analysis/report files.


The EXE Directory

The directory where VBC will instruct VB to write new executable files.


The VB Directory

The directory where VBC looks for VB.EXE.  This can be left blank if the directory is in your path.


The Project Directory

The Project Directory tells VBC where to find the projects you wish to compress.

To set the project directory it from the keyboard, just, type your entry, and hit ENTER or change the focus.

To set the directory with the mouse, click the directory icon to the right of the textbox, and use the Set Directory Window that pops up.

When the Project Dir is set, the Project List shows all project files in the directory.  By default, the list will include all files ending with VB's standard MAK extension.  You can change the extension, however,  by double-clicking the Project List label and entering your spec in the input box.


The Project List

The Project List, located on VBC's main window, shows all project files in the currently selected project directory.  By default, the list includes all files ending with VB's standard MAK extension.  You can change the extension by double-clicking the Project List label and entering your spec.

Selecting a project on the list (arrow or single click) causes VBC to do a quickie project analysis and fill out the Project Information List.   VBC also adds the project name to the Compress, Make EXE, Text Save/Load, and Binary/Ascii Save items on the Compress Menu.

Double clicking a project on the project list initiates optimization.

If you select Start VB on the Compress Menu, VBC will ask if you want to load the currently selected project on start up.

Note: You can change the height of this list by dragging the space between it and the VBC Report / Project List


The VBC Report / Project List

The VBC Report / Project List, located on the Main Window below the Project List, has two names because its contents depend on the current setting of the Retain Optimized Code option.

If Retain Optimized Code is set to No, this list shows all VBC report files, i.e  all files in the currently specified Report  Directory ending in VBC's report file extension.  Double clicking a report file starts the Report File Viewer and loads the report.

If Retain Optimized Code is set to Yes, the list shows all optimized projects in the New Project Directory, i.e. all files with an MAK extension.  In this state, the list duplicates the functions of the Project List; e.g. selecting a project fills out the Project Information List, etc.

In either case, selecting a file on the list  converts the Analyze command into the View Info command.  This lets you view a report even if the list is currently displaying projects.

Note: You can change the height of the list by dragging the bar between it and the Project List above it.


The Project Information List

Whenever a project is selected,  the Project Information List is updated with information about the project.

The information includes the name, size, type and format of all project files, and a line count for all files in Ascii format.  It will also tell you project totals, and, if found, the size of the EXE file.

Pro Only:

If you have the Professional Edition of VBC, the list will include a line reading "Double Click here for Code Analysis."  Double click it  for a quickie code analysis!


Files Created by VB Compress

VBC creates numerous files as it runs, in several different directories.  Some are written to the Scratch directory, some to the New Project Directory, some to the Report Directory, and one (the new EXE) to the EXE directory.  These files can be grouped in three categories: temporary, optimized code, and final.

Temporary files are generated  and used internally during analysis and/or optimization, but are always deleted when processing completes.  The only time you would see these files is if (heaven forbid) VBC should crash.

Optimized Code files, are generated during analysis and/or optimization, are used to generate the new executable, and are retained after successful creation of an EXE only if the Retain Optimized Code program option is set to Yes.

Final files are generated during analysis and/or optimization and are never deleted.

Click the file type for which you'd like more information

See Also:

File Name Summary


Temporary Files

VBC creates two types of temporary files: those used to generate optimized project code, and those used to generate reports.  These files are always deleted upon successful completion of processing.

VBC always creates one temporary code file for each file in the project.  These files, named after the original but with an H## extension, are written to the Scratch directory.  They contain declarations, and are deleted as VBC builds the final code.

If any of your project files are stored in binary format and the Binary Project Files option is set to Convert Copies (the default), VBC will instruct VB to save ASCII versions of them, also in the Scratch directory.

If you have requested a report, VBC creates one or two temporary report files for each file in the project.  Also named after the original but with an F## or P## extension, they are written to the Report Directory.  F## files contain file-level info and P## files contain procedure level info.  See the Organization report option for more information on these files.

If your report requests local information, VBC creates an additional temp file of local identifier information.  This file, also named after the project, has an LID extension.

See also:

Files Created by VB Compress

Optimized Code Files

Final Files


Optimized Code Files

Optimized Code Files are the files created by VBC that make up the optimized version of your project.  They are all written to the New Project directory, and are retained after successful creation of an EXE only if Retain Optimized Code is set to Yes.  If you are using VBC for interactive debugging, therefore, set this option to preserve the files.

All optimized code files are in Ascii format, and in general they have the same names and match one-for-one with the original project files.  The project file itself and all form files are always replicated.  When set to Yes, however, the  Make 1 Global,  Make 1 Module, and Substring Matching options create a few variations in module files:

Make 1 Global and Make 1 Module Variations

If the Make 1 Global option is set to Yes, VBC creates a new consolidated global file and includes it in the new project.  This file has the same name as the project and an extension of VCG.

If the Make 1 Module option is set to Yes, VBC creates a new consolidated module file and includes it in the new project.  This file has the same name as the project and an extension of VCM.  The VCM file replaces all of the modules files in the original project.

Note that if both options are set to Yes, VBC creates both the VCG and the VCM files; Make 1 Global overrides Make 1 Module, forcing the creation of a second module.

Substring Matching Files (Pro Only)

If you have the Pro version of VBC and are using substring matching, VBC will generate two additional files.  The String Literal file, with the same name as the project and an extension of VCS, contains all of the embedded strings that VBC finds in the project.  The String Constants file, with the same name as the project and an extension of VCC, contains the global string constants that VBC derived from the literals according to substring matching parameter settings.

The VCC file is included in the project, while the VCS file is not.  The only reason that we don't have VBC treat it as a temporary file and delete it is that we thought you might be interested in seeing what the string literals are, and how much space they take up in your project.  It's also handy for running a spell check.

See also:

Files Created by VB Compress

File Name Summary

Temporary Files

Final Files


Final Files

Depending on how process and report options are set, VBC generates up to 2 final files.  Final files are never deleted.

If the Interaction with VB process option is set to Compile or Compile and Exit, VBC will instruct VB to make an optimized executable.  This file, with the same name as the project, is written to the EXE directory.

If report options are set to generate any information, it will be written to a file with the same name as the project and the report file extension, in the Report Directory.

See also:

Files Created by VB Compress

File Name Summary

Temporary Files

Optimized Code files


The Error Log File

When VBC's Error Logging option is set to Yes or Extended, error information is recorded in a file named VBCERROR.LOG.

If you have the single-user version of VBC, the error log file is written in the directory where VBC is installed.

If you have a multi-user network version of VBC, the error log file is written  in the local windows directory.

VBC always appends to the Error Log file, so it grows continuously until manually deleted.


The Reserved Word File

The Reserved Word File, set during installation and accessible on the Reserved Word List Window, tells VBC the full path and filename for the list of reserved words.

VBC will not execute if this file cannot be located.

See also:

The Reserved Word List


The Debug Statement File Pro Only
The Debug Statement File (Pro Only)

The Debug Statement File, accessible on the Debug Statement List Window, tells VBC the full path and filename for your list of debug statements.

See also:

Debug Statement Handling

Debug Statement List


The Initialization File

The initialization file VBCOMP.INI, located in your VB Compress program directory, retains configuration option settings and other information.  If not found on start up, VBC uses default values.

If you are using a multi-user network version of VBC, VBCOMP.INI will be read and written to your local windows directory to allow each user to retain their own configuration.

Unless you are using the /INI command line switch,VBC always reads the initialization file on startup and rewrites on exit.


Command Line Options

VBC  recognizes and reacts to three command line switches designed to support automated operation:

Compressing a Project from the Command Line: The /P Switch

Batch Processing without Interruption: The /NOSTOP Switch

Using Alternate Option Settings: The /INI Switch

It also recognizes two command line switches that modify reporting behavior:

Suppressing File & Procedure References: The /NFR and /NPR Switches

And if you want to comment out rather than remove unreferenced procedures, you should know about:

Commenting Out Procedure Bodies: The /CPB Switch


Compressing a Project from the Command Line: The /P Switch

The /P switch lets you command VBC to compress a project from the command line, handy if you use some sort of Windows batch language.

If you start VB Compress with /P followed by the filespec of a valid project on the command line, it will start, compress the project,and terminate (note, though, that if VBC encounters errors along the way, it will stop and await intervention unless you have also used the /NOSTOP switch).

For example, to compress IconWorks from the command line:

1.  Select RUN from the Program Manager FILE menu

2.  Type "c:\vbcomp3\vbcomp3 /p c:\vb\samples\iconwrks\iconwrks" in the command line box

3.  Click OK

If you omit the filename extension, MAK is assumed.


Batch Processing without Interruption: The /NOSTOP Switch

When VBC is processing a project or instructing VB to load and compile it, it may (Heaven Forbid!) encounter an error of some sort.  Errors cause VBC to stop what it's doing, report the error, and await your informed decision as to what to do next.

In some circumstances, however  -- say you are batch processing all projects in a directory, or you are using the /P Switch to run from the command line --  this behavior is undesirable.

Starting VBC with /NOSTOP on the command line eliminates the problem because, when used, it causes VBC to abort on errors.

Note: When using /NOSTOP, turning on Error Logging is a very good idea so that you can find out later if anything went wrong.


Using Alternate Option Settings: The /INI Switch

By default, the single user version of VBC stores and retrieves option settings using the initialization file located in the directory where it is installed.  The multi-user version stores and retrieves from the local Windows directory.

The /INI switch, however, lets you use different options by telling VBC to use a different file.  To use it, set VBC's options as desired, then exit the program and copy the standard initialization file with a new name or to a different directory.  Then restart VBC with /INI NewName on the command line, and it will use that file instead of the standard.

Note: When using the /INI switch, the file name given MUST include a full path.


Suppressing File & Procedure References: The /NFR & /NPR Switches

When VBC builds reports, its default behavior is to construct identifier names with as much information as is needed to completely and uniquely identify items.  Thus in the project-level section of a report, all items have the name of the file or form in which they are declared prepended to them, and local items have both a file or form name and the name of the procedure in which they are defined.  In the file-level section of reports, file references to items within the file are dropped, but other file references and proc info is retained.

For example, the global constant SRCCOPY defined in the ICONWRKS sample app is referenced as "(iconwrks.gbl)SRCCOPY", the form constant WF_ENHANCED is referenced as "AboutBox:WF_ENHANCED", and the local variable NewTop is referenced as "Editor:Adjust_Status_Bar:NewTop."

This is a generally useful way to report stuff, but it does make for rather long names and big reports.  If for any reason you wish to modify this behavior, you can use the /NFR (no file ref) and/or the /NPR (no proc ref) switches on the command line.  The /NFR switch suppresses all file referencing, and the /NPR switch suppresses all procedure referencing.

Either switch can speed up VBC, because resolving these references takes time.


Commenting Procedure Bodies Only: The /CPB Switch

VBC gives you the option of commenting out unreferenced procedures, rather than removing them.  However, if VBC finds and comments out many such procedures in a single file, the resulting code can choke VB with a "too much form/module level code" error.  This is because VB will attempt to insert the commented procedures into the file's declaration section, which is limited to 64K.

If you encounter such a problem, you can get around it by restarting VBC with the /CPB command line switch.  When this switch is used (it stands for "Comment Proc Body Only"), VBC comments all of the code within the procedure, but leaves the declaration and the end sub/function intact.  The procedures WILL exist in the project, but they'll do nothing.

Note:  If the only reference to a user-defined data type is in the argument list for a procedure so commented, the resulting code will generate a "type not defined" error unless you configure VBC to ignore unreferenced types.


The Reserved Word List

The Reserved Word List, contained in the RESWORDS.LST file that ships with VBC, contains all words reserved by the latest version of VB.  If you use additional custom controls, you may want to update it for the reasons discussed below.

The Reserved Word List  serves two functions:

Identifying Implicit Variables

VBC's procedure-level reports include an analysis of implicit variables, used but never declared.  The only way to identify implicit variables is by default, i.e by determining that they're not something else.  VBC knows all global and form /module level identifiers from analyzing the project.  When it analyzes a procedure, it categorizes these, identifies all explicitly declared local identifiers, then checks everything that's left against the reserved word list.  Anything not found on the list is considered to be an implicit variable.

This is a non-critical use of the list, because if the list is incomplete, the worst that happens is that VBC reports language elements as implicit variables.  It does not affect the optimization process.

Identifying Event Procedures with the CTRL_EVENT Method

If you have selected CTRL_EVENT as the event procedure id method, VBC relies on the reserved word list to identify  event procedures.  If you use the CTRL_EVENT method, therefore, and if you use custom controls with custom events, then you need to add these events to the Reserved Word List, as discussed below, else VBC can screw things up.  If you follow our recommendation not to use this method, you don't have to worry about it.

Updating the List

Defining exactly which words related to a new control need to be on the list is a bit involved.

You do not need to add the name of the control, but you do need to add its "object" or "class" type,  i.e. the word the vendor's documentation tells you to use with VB's "If TypeOf" statement.

You generally do not need to add properties or methods, because when used in code, they are usually attached to a control.  VBC identifies the controls in your project and can generally figure out that something appended to a control is a reserved word.

The exceptions are form properties like "Caption" that can be used without a control name and hence belong on the list.  Since this only applies to form properties, however, you don't have to worry about it; they're all there on the list when VBC ships.

You do need to add custom events, and when doing so, you need to identify them as events.  For the CTRL_EVENT method  to work properly, VBC needs to know exactly which words on the list refer to events.

When you add an event name to the list, therefore, you need to mark it as such by following it with a space and the word "event."  If, for example, you got a new control with a "Burp" event, you should add "burp event" instead of just "burp."  If you study the list, you will see that all event names are so designated.

See Also:

Check Reserved Words


The Debug Statement List Pro Only
The Debug Statement List (Pro Only)

The Pro Version of VBC allows you to define a list of debug statements that you want to keep in your original project code but have removed from or flagged in the code used to produce the executable.

If you have the Debug Statement Handling process option set to anything other than IGNORE, VBC compares each line of project code to each item on this list and acts accordingly when a match is found.

Matching Rules

1) Case does not matter: debug.print matches DEBUG.PRINT and  Debug.Print.

2) Leading spaces do not matter.

3) Any part of the line of code beyond the length of the debug statement on the list does not matter:  It's a match if the begining of the line matches the defined statement.  If, for example, you have "If DEBUG = True" on your list, any line of code starting with "If DEBUG = True" is a match.


Type Declaration Character

A  character used to terminate an identifier that indicates the type of data it identifies:

% Integer

& Long Integer

! Floating Point, Single Precision

# Floating Point, Double Precision

@ Currency

$ String


Ordering Info
Ordering Information

To order VB COMPRESS PRO, please contact:

QBS Software

10 Barley Mow Passage

London W4 4PH

ENGLAND

Tel:	+44 181 994 4842

FAX:	+44 181 994 3441

BBS:	+44 181 747 1979


Extension Syntax

For any file extension ending in ##, the actual extension will end in a formatted number corresponding to the parent file's position in the project list.


File Name Summary

Here's a quick summary of the oddball files VBC may create:

ProjName.VCG	Consolidated global file

ProjName.VCM	Consolidated module file

ProjName.VCC	Global string constant file (Pro Only)

ProjName.VCS	Embedded string literal file (Pro Only)

Note:  "ProjName" indicates that the file has the same name as the original project.


Non-Event Procedure aka General Purpose
Non-Event Procedure (aka General Purpose)

A procedure that is NOT associated with nor triggered by a VB control.  All module-level subs and functions, and all form-level functions, are non-event procedures.  So are form-level subs defined by the developer that do not consist of a control name and an event name connected by an underscore.

Non-event procedures are triggered by code, not events.


Event Procedures

Form-level subroutines associated with a control and triggered by a control event.  The names of event procedures always consist of the name of the control and the name of the event joined by an underscore, e.g. Check1_Click.


Identifiers

The names assigned to constants, variables, sub and function procedures, and labels.


Project File Type

The files in a VB project fall into 1 of 3 categories, signified by a letter:

f	=> form file

m	=> module file

c	=> custom control library

Note: VB1 also had a global type, but this disappeared with the new ability to declare globals in any module file.


Legal Stuff

Microsoft and Visual Basic are registered trademarks of Microsoft Corporation.

Windows and Tech-Ed are trademarks of Microsoft Corporation.

The Visual Basic Programming Language is copyrighted by Microsoft Corporation.

WhippleWare, VB Compress, and VB Compress Pro are trademarks of WhippleWare.

The VB Compress applications are copyrighted by WhippleWare.

Visual Basic Programmers Journal and VBITS are registered trademarks of Fawcette Technical Publications.


Procedure Level Identifiers

Procedure level (local) identifiers are all identifiers either formally declared within a procedure, or those referenced within a procedure and NOT declared elsewhere, and NOT on the reserved word list.


Process Options

Process Options allow you to control VBC's optimization process.  They are divided into two categories:

Global Options control VBC processing as it relates to globals

Code Options control VBC processing as it relates to code.

Click any option for which you'd like more information.

Global

Make 1 Global

Def Data Types

Form API Declarations

Duplicate API Declarations

Code

Make 1 Module

Def Data Types

Event Proc ID

Line Spacing

Comments

Reserved Word Checking

Reorder Declare

Pro Only

Assertion

Debug Statement Handling

Substring Matching

See Also:

Unreferenced Item Processing

Special Considerations When Processing Unreferenced Local Items


Global Process Options

These options control VBC processing as it relates to globals.  Click the specific option for which you would like more information

Make 1 Global

Def Data Types

Form API Declarations

Duplicate API Declarations


Make 1 Global

The Make 1 Global process option, set on the Process Options Window, instructs VBC to consolidate global identifiers found anywhere in project code into a single file.

Unreferenced globals are handled as specified by the Unreferenced Item process option settings.

Global consolidation can give you better organized code.  It can also occasionally cause Global Consolidation Errors, which, though easily fixed, can prevent successful EXE creation.

See Also:

Optimized Code files


Default Data Types

VB allows you to set file-level default data types.  If you do not, variables declared without a type declaration character default to Variant, which are slick but clunky and can slow down your program.  Always defaulting to integers (DefInt A-Z) is a very good idea for efficient code.

Default data typing matters to VBC if you have instructed it to consolidate files with the Make 1 Global or Make 1 Module process options.  There is no problem if all files from which items are extracted have the same defaults, but there is a potential problem if the defaults do not match.

The Def Data Type process options, one each for globals and modules, are enabled when consolidation is turned on.  These options give you control over the defaults used in the consolidated file, and can be set as follows, with the results described:

AS_IS

If the defaults match across files, there is no problem and VBC simply uses the same defaults in the consolidated file.

If the defaults do not match, VBC will stop and query you with the Consolidation Problem Window and depending on your response, either continue, quit, or pop up the Set Default Data Type Window.

SET@RUN

The Set Default Data Type Window pops up at run time.  This window shows you the defaults in all files to be consolidated and allows you to set the defaults for the consolidated file as you wish.

DEF...

VBC will default all variables (A-Z) to the data type you select.  If you wish to be more selective, use SET @ RUN.


Form API Declarations

The Form API Declaration process option, set on the Process Options Window,  is enabled only when Make 1 Global is set.  The two possible settings are as follows, with the results described:

LEAVE IN FORM

Form-level API/DLL function declarations are left as is.

MOVE TO GLOBAL

All form-based API/DLL function declarations are relocated to the new single global.  This will shrink your EXE if functions are declared more than once across the project, because duplicate declarations add no overhead if they are made in the same file, but do add overhead if they are in different files.  It also gives you better organized code.


Duplicate API Declarations

The Duplicate API Declaration process option, set on the Process Options Window, controls how VBC handles duplicate API/DLL declarations found in different module files.  Duplicates can be removed, marked, commented out, or ignored.


Code Process Options

The Code Process Options, set on the Process Options Window, determine the code-related aspects of VBC behavior as it creates the optimized copy of your code.  Click the option for which you'd like more information:

Make 1 Module

Def Data Types

Event Proc ID

Line Spacing

Comments

Reserved Word Checking

Reorder Declare

Pro Only:

Debug Statement Handling

Assertion

Substring Matching

See Also:

Process Options


Make 1 Module

The Make 1 Module process option, set on the Process Options Window, is relevant only if the project you are compressing has more than one module file.

There are 3 possible settings: YES, NO, and NO, DON'T ASK.

If this option is set to YES, VBC will write all module routines into a single optimized module file.  Otherwise, VBC will create optimized versions of each module file.

Unreferenced module procedures are handled as specified by the Unreferenced Item process option setting.

VB executables grow in size with the number of modules (each adds about 256 bytes of overhead), so setting this option results in a smaller EXE and is recommended if your project has numerous modules.

In some circumstances, doing so can lead to  Module Consolidation Errors.  However, VBC  anticipates most problems and queries you at run time.

If this option is set to NO and your project has multiple modules, VBC checks to see if modules might be consolidated without causing problems, and if so, asks at run-time if you want to do so.  If set to NO, DON'T ASK, VBC neither checks nor queries.

See Also:

Optimized Code files


Debug Statement Handling Pro Only
Debug Statement Handling (Pro Only)

If you have defined a list of standard debug statements, the Debug Statement Handling process option, set on the Process Options Window, controls VBC behavior when it encounters any of these statements in code.  The possible settings are as follows, with the results described:

IGNORE

VBC will copy the debug statement as is to the optimized copy.

LEAVE and MARK

VBC will copy the statement but append a comment flagging it as debug code.

COMMENT OUT

VBC copies the statement but comments it out.

REMOVE

VBC does not copy the statement.

See Also:

Debug Statement List


Event Proc ID

The Event Proc ID process option, set on the Process Options Window, determines how VBC distinguishes form based procedures as event procs or non-event procs.  It is relevant if you have set the unreferenced form procedure process option to anything other than IGNORE.

VBC can identify and remove unreferenced procedures from your code.  Before removing them from forms, however, it must determine that they are not event procs, which are often unreferenced but can always be triggered by the user and should never be removed.

This option has two possible settings, with the results described:

CTRL_

Any form procedure whose name starts with a control name and an underscore is considered to be an event proc and is never removed.  This is the conservative setting, as the only possible error is to include procedures that are named after a control but are not in fact event driven.

CTRL_EVENT

The balance of the procedure name following the underscore must also match an event name on the reserved word list.  This is the riskier setting, because a) if you use custom controls with custom events, and b) you have not added these events to the reserved word list, then c) VBC could remove event procedures and screw things up.

This setting is included for those who like to carry control names over into related non-event procs, but it is not recommended.


Assertion Pro Only
Assertion (Pro Only)

The Assertion process option, set on the Process Options Window, activates and deactivates VBC's Assertion equivalence processing.  When assertion is active, VBC inserts  your assertion statement into each procedure in your project.  The statement can be used for debugging, error handling,  or whatever you want.

The assertion statement is simply any VB statement that includes a procedure identification string.  You construct it by using the Assertion Statement Definition Window that pops up when you activate assertion.

The Assertion statement has three parts: the prefix, the procedure ID message, and the suffix.  You define the prefix and the suffix, and VBC constructs the statement by sandwiching the PID message between them.

For Example

Say that you want a message box to pop up and announce entry to each procedure.

Define the prefix as:

'MsgBox "Now entering "+ '

and  the suffix as

', 0, ""'.

VBC will:

1) construct the statement as

'MsgBox  "Now Entering "+{PID$}, 0, ""'

2) alias {PID$} with the name of the form or module and the name of the procedure, and

3) insert it into each defined procedure.

When Form1 begins to load, assuming there is load code to begin with, you get the message:

"Now Entering Form1:Form_Load"

You can make the assertion statement as elaborate as you like.  If, for example, you wanted the option of conditional execution, you could define the prefix as

'If MsgBox ('

and the suffix as

', MB_YESNO + MB_ICONQUESTION, "Continue Execution?") = IDNO then Exit Sub"

One user (a tip of the hat to Lawrence Calmus!) was puzzled by the thread of execution in his project, and used assertion to make what he called "a kludgy profiler."  All he did was define the prefix as "Printer.Print " and left the suffix blank.  Then when he ran his project, it dumped the thread to the printer, and he figured things out in no time.

The usefulness of assertion is that it makes the name of the current procedure always available as a variable with no extra work on your part.  To make the most of it, however, you may want to add code that uses the variable to the code produced by VBC.  That's what we did when we used assertion to develop VB Compress.  We simply used the default "ProcName$ =" prefix, then added to the error handler an announcement of the current proc name.  If, Heaven forbid, you ever see a VBC error message, this is where the procedure name came from.

With assertion, you can announce and test many different things.  You can do all kinds of stuff.  Use your imagination!  Go wild.


Substring Matching Pro Only
Substring Matching (Pro Only)

The Substring Matching process option, set on the Process Options Window, activates and deactivates VBC's substring matching.  Substring Matching helps reduce the size of communicative interfaces by identifying repeated words and phrases and replacing them with global string constants.  Because it can be configured to turn ALL string literals into global constants, moreover, it is also useful for helping create multi-language programs.

Activating this option pops up the SS Parameters Window, where you set parameters to control the matching process:

Minimum Word Length sets the length of the shortest word VBC will convert to a constant.

Minimum Word Frequency sets the number of times a word must occur for VBC to convert it to a constant.

VBC uses the String Constant Prefix to construct the constants.

The values assigned to the length and frequency parameters are important, because substring matching is not a free good: when activated, you are trading off the space used by repeated strings for the space used by global string constants and string concatenation ops.  Setting either length or frequency values too low could actually increase the size of your final EXE rather than reduce it.  The default values are 5 and 5, but you should experiment to find the optimal values for your project.

Substring Matching in Action

Substring matching is a three step process.  The first step occurs during the initial read of your code, when VBC is loading and reading all code to track down unreferenced procedures.  Before it unloads the code for each form or module, it dumps all embedded string literals into a temporary file in the scratch directory.

VBC performs the second and third steps when it loads and analyses your code procedure by procedure to identify unreferenced constants, variables, etc.

The second step, initialization, occurs when the first procedure is loaded.  VBC reads the string literal file, analyses the strings according to your rules, and creates a global string constant  file that will be included in the optimized project.  VBC uses the string constant prefix set in the parameter window to construct the constants, and appends the frequency of use as a comment after each is defined.  Constants are defined in order of decreasing frequency.

The third step, in which VBC rebuilds string literals using the string constants, occurs after each procedure is analyzed and just before it is written to disk as new project code.

The files created by substring matching are described in the discussion of Optimized Code files.


Line Spacing

The Line Spacing process option, set on the Process Options Window, controls the line spacing format used in the optimized copy of project code.  It has four possible settings, as follows, with the results described:

AS_IS

No changes are made; line spacing in the new copy matches the original.

SINGLE

All blank lines are removed.

DOUBLE or TRIPLE

All blank lines are removed and then 1 or 2 blank lines are inserted between each line of code.

Note: You can use these options to 'pretty print' your code.  In VB 2+, however, unlike VB 1.0, line spacing has no effect on EXE size.


Comments

The Comments process option, set on the Process Options Window, controls the handling of comments in the optimized copy of project code.  The two possible settings are as follows, with the results described:

REMOVE

Comments are removed.

PRESERVE

Comments are preserved.

Note: In VB 2+, unlike VB 1.0, comments have no effect on EXE size.


Check Reserved Words

The Check Reserved Words option, set on the Process Options Window, is a bit complicated.  If you don't care about nitty gritty, leave it set to Yes (the default setting) and ignore the following discussion.  Setting it to No speeds up VBC's processing but, under certain circumstances, can also cause VBC to miss references and thus improperly remove items from optimized code.

The Check Reserved Words option determines VBC's behavior when, while parsing your code looking for references, it finds a token on the list of reserved words.  If set to NO, VBC  identifies the token as a reserved word and moves on to the next token.  If set to Yes, VBC checks to see if the token is also on any of  the internal lists it has built of project variables, constants,  procedures, etc.

The need for this option stems from the ambiguity in the "reserved" status of  various words (in particular, properties and database objects) in the VB language.  Properties were reserved words in the first edition of VB, but not in subsequent versions.  This means that in VB2 and beyond, it is perfectly legal to use, say, "Path" or "Text" as variable names.  If you do, and if they are on the reserved word list, and if this option is set to No, all references to them will be treated as references to language elements and VBC will consider them unreferenced and remove them (oops).  If set to Yes, though, no problem.

Some of the words used by VB's database functions can also cause problems; Index, for example, is a database object, and it's included it on the reserved word list so VBC won't report it as an implicit variable.  Index is also a commonly used variable name, however, so the same situation applies.

The current version of VBC ships with no properties except form properties on the reserved word list, and hence there should be no problem with property names even when this option is set to No.  The database objects are on the list, though, and users have the option of adding words.  So things can get mucked up, and I recommend that you leave reserved word checking set to Yes.

See Also:

The Reserved Word List


Reorder Declaration Sections

The Reorder Declares option, set on the Process Options Window, determines whether or not VBC reorganizes the declaration sections of all forms and modules in the optimized code that it generates.

If this option is set to No, items are declared in the declaration sections in the same order in which they are declared in the original code.  If Make 1 Global or Make 1 Module is set, the declarations sections will be consolidated in the same order in which the original files appear in VB's project window.

If this option is set to Yes, the declaration sections will be reorganized as follows, with comments inserted marking the beginning of each section:

1) Global Constants

2) Type Definitions

3) API / DLL Function Declarations

4) Global Variables

5) Form / Module Constants

6) Form / Module Variables

When VBC writes the declaration section of a single global or module file, moreover, it also reorganizes within these sections to avoid dependency problems.  For each item within each section, it identifies the number of dependencies in its definition (eg, "global const c1=0" has none, "global const c2=c1+2" has one, and "global const c3=c1+c2" has two).  Then it writes them out in ascending order of dependencies.

When this option is set to Yes:

1) it neatens things up, but more importantly,

2) it eliminates most of the out-of-order dependency errors that can crop up when either consolidation option is set.


Program Options

The Program Options, set on the Program Options Window,  control assorted aspects of VBC behavior.  Click the option for which you'd like more information:

Binary Project Files

Interaction with VB

Retain Optimized Code

Beep On Error

Error Logging

Grey Display

Status Window Updating  (Pro Only)

Help System Interaction


Binary Project Files

VB allows you to save your form and module files in ASCII or binary format.  VBC, however, needs ASCII code files to do its work, and thus always begins the processing cycle by instructing VB to resave any binary files in ASCII format.  The Binary Project Files program option, set on the Program Options Window, determines whether these ASCII versions are written to another directory or, if converted in place, whether files thus converted are restored to binary format when processing is complete.

If set to Convert Copies (the default), VBC instructs VB to save the ASCII versions in the Scratch directory, leaving the original files untouched.

If set to Convert & Restore, VBC converts the original files in place, but ends the processing cycle by instructing VB to restoring any converted files to their original binary format.

If set to Convert & Leave, converted project files are left in ASCII format.


Interaction with VB

The Interaction with VB process option, set on the Program Options Window, controls VBC's interaction with VB when it completes processing.  The 4 possible settings are as follows, with the results described:

NONE

VBC returns to the main window without calling VB.  All optimized code files are retained, regardless of the Retain Optimized Code option setting.

LOAD PRJ

VBC start VB, loads the optimized project, pops the VB Control Window into the lower left corner of the screen, and goes to sleep until you exit VB.

COMPILE PRJ

VBC starts VB, loads the project, makes the EXE, pops the VB Control Window into the lower left corner of the screen, and goes to sleep until you exit VB.

COMPILE & EXIT

VBC  starts VB, loads the project, makes the EXE, exits VB, and restores the main window.

Note: Whatever the setting of this option, any problems VBC encounters while controlling VB causes it to pop up the VB Error Window and ask what you want to do.


Retain Optimized Code

The Retain Optimized Code option, set on the program options window, determines whether VBC retains or deletes the  optimized code files it creates after it has used them to create a new EXE.

If set to YES, the new code files are retained in the New Project Directory.

If set to NO, the new code files are deleted.

Note:  Two circumstances override this option, however it it set:

1) If you cancel processing, the files are always deleted.

2) If Interaction with VB is set to None, the files are always retained.

See Also:

Files Created by VBC


Beep on Error

If the Beep on Error option, set on the Program Options Window, is set to Yes, VBC beeps whenever it encounters an error or needs attention.  Otherwise it waits silently.


Error Logging

The Error Logging option, set on the Program Options Window, determines whether or not VBC  records error information in the error log file on disk, and how much.  The 3 possible settings are as follows, with the results described:

No

No error information is recorded.

Yes

Error information is recorded.  The information always includes time, date, project name, and a description of the error.  Other information recorded depends on whether the error is a VBC error or a VB error.

If the error was generated by VBC while processing your code (a VBC error) the information includes the VBC routine where the error occurred and, if relevant, the line of project code being processed at the time of the error.

If the error was generated by VB while trying to load or compile the code generated by VBC (a VB error), the information includes the line of code and the token highlighted by VB when it reports the error.

In either case, the information recorded is identical to that shown on the VB Error Window, unless you are running VBC  with the /NOSTOP switch.

Extended

In addition to the all information just described, VBC records the current settings of all options.

See Also:

The /NOSTOP Switch

Technical Support


Grey Display

If the Grey Display process option, set on the Program Options Window, is set to Yes, all windows are given that grey sculpted look that is all the rage these days.  It also slows down screen painting, though not very much.

If this option is not checked, you get plain old flat white windows.


Locate Help

The Locate Help process option, set on the Program Options Window, controls positioning of VBC's Help Window.

If Locate Help is set to Yes, VBC packages help requests with a resizing message that fits the Help Window between the edge of the screen and the edge of the calling window.  The Help Window will be positioned to whichever side of the calling window is furthest from the edge of the screen.

If Locate Help is set to No, VBC does not change the size or position of the Help Window.

Note:  If your screen is running @ 800x600 or greater, the Locate Help function works great.  If you are running at 640x480, the Help Window ends up a bit small, and you may want to shut it off.


Status Window Updating Pro Only
Status Window Updating (Pro Only)

The Status Window Updating option, set on the Program Options Window, trades status information for processing speed.

VBC's Status Window was designed to keep you always informed about precisely what VBC is doing.  However, most of the video cards on the current crop of high powered PCs are not quite up to snuff with their 486 processors, and the screen updating involved can impose a significant penalty on processing time.  With Pro's emphasis on interactive debugging rather than black box optimization, we added this option to let you trade status information for speed.

The option has three setting, as follows, with the results described.

NORMAL

VBC performs all status updates -- routine, file, and project.

LESS FREQUENT

VBC skips routine updates altogether and updates file by file and project-wide less frequently.  The display gets a little jerky, but processing speeds up 25% or so.

MINIMAL

VBC updates on a project basis only.  The display shows very little information, but processing can accelerate 40-50%.

See Also:

The Status Window


Unreferenced Item Processing

The Unreferenced Item Process Options, set on the Process Options Window, dictate how VBC handles the unreferenced items it finds in your code.  VBC can be configured to handle each of  the 14  possible type / scope combinations differently.

You may also set them all the same by clicking the Set All control.

There are four possible settings for each type/scope combination, as follows, with the results described:

IGNORE

Unreferenced items with the given type/scope are included in the optimized project with no change

LEAVE & MARK

Unreferenced items with the given type/scope are included, but with a trailing "VBC NO REF" comment

COMMENT OUT

Unreferenced items with the given type/scope are included as comments in the new project code.

REMOVE

Unreferenced items with the given type/scope are omitted from new project code.

Note 1:  Both the "Leave & Mark" and "Comment Out" settings increase the amount of text in the new code file.  This is rarely a problem, but if the original code was approaching VB's size limits, these two settings can cause VBC to generate code that VB can't load.  For more information, see the discussion of Out of Memory Errors.

Note 2: Beginning with version 3.01, VBC has the ability to handle local constants, variables, and labels.  See Special Considerations When Processing Unreferenced Local Items


Special Considerations When Processing Unreferenced Local Items

Beginning with version 3.01, VBC has the ability to "handle" unreferenced local constants, variables, and labels, ie to ignore, mark, comment out, or remove them.  VBC's default behavior is to insert a comment noting them but to do nothing.  This is because extensive testing shows that unless there are lots of them, which is rare, the impact on EXE size and speed is negligible.

If you change this behavior, there are two things to keep in mind.

1) A very common coding practice is declare multiple items on a single line, eg "Dim i, j, k" or "Const A=1, B=2".  If you instruct VBC to do anything other than ignore unreferenced local items, however, it will rewrite all such declarations to one per line.  "Dim i, j k" would become 3 separate lines "Dim i", "Dim j" and "Dim k", and "Const A=1, B=2" would become 2 lines, "Const A=1" and "Const B=2."  The alert user will notice an increase in the line count in the optimized code, though there will be no impact on EXE size.  This behavior simplifies the processing of individual items.

2) VBC  will not allow you to select "comment out" for unreferenced labels.  Why not?  Because even if a label isn't referenced, any code on the same line most likely still executes, and if VBC commented out the line, it wouldn't!  Instructing VBC to remove unref labels doesn't create this problem because VBC will not delete the line; instead, it replaces the label with white space.


Report Options

Report Options, set on the Report Options Window, gives you precise control over the project analysis that VBC performs and reports.  They are divided into three categories.

Sections to Generate Options control report content at a high level.

Items to Include Options control report content at a finer level.

Format Options control report format.

Click any option for which you'd like more information:

Sections to Generate

VBC Configuration Info

Project File Info

Code by Category

Ref / Unref Info

Items to Include

Items to Include

Special Considerations When Including Local Items

Report Format Options

Organization

Pagination

Page Composition

Other Options

Report File Extension

External Report Viewer


Sections to Generate

These report options, set on the Report Options Window, control the level of information VBC will include in reports.

Click the report option for which you'd like more information:

VBC Configuration Info

Project File Info

Ref / Unref Info


VBC Configuration Info

The VBC Config Info report option, set on the Report Options Window, controls the amount of VBC configuration information included in the header section of reports.

It has 4 possible settings, as follows, with the results described:

ALL INFO

Complete configuration info is included, including all process and report option setting.

REPORT INFO or PROCESS INFO

Report or Process options are included.

NONE

No configuration info is included.


Project File Info

The Project File Info report option, set on the Report Options Window, controls the amount of project file information that will be included in the header section of reports.

It has 4 possible settings, as follows, with the results described:

BOTH PROJECTS

Project file information on both the original and optimized project is included.

ORIGINAL or PROCESSED

Information about the selected project is included.

NONE

No project file information is included.

Note: Project file information includes standard file info (date, size, etc) as well as format, type, line count if Ascii, procedures, controls, and globals.  The information is reported for each file and for the project as a whole.

See Also:

Code by Category


Code by Category Pro Only
Code by Category (Pro Only)

The Code by Category option, set on the Report Options Window and only available in VBC's Professional Version,  determines if lines of code by category information is included in the header section of reports.  If set to Yes, the information is provided for the project(s) specified above in the Project File Information option.  Code by category information is unavailable when Project File Information is set to None.

Code by category information, the result of a line-by-line analysis of project code, tells you for each file and for the project as a whole, how many lines and what percentage of code are in each of the following categories:

Form Definition

Declarations

Sub / Function Headers & Footers

Local Dim, Redim, Static

Executable Statements

Comments

Blank Lines

Total

Note: If your project is stored in ASCII format, you can get a quickie code by category analysis by double clicking where it says to double click on the project file list on VBC's main window.


Ref / Unref Info

The Ref/Unref Info report options, set on the Report Options Window, determine what information is included in the body of VBC reports.  They work in conjunction with the Items to Include report options.

You set these options independently for each of 3 levels of analysis: project, form/module, and procedure.

There are 4 possible setting for each level, as follows, with the results described:

NONE

The report will include no information for the level of analysis.

SUMMARY

The report will included a reference / unreference summary for each item at the level of analysis; one per project, one per form or module, one per procedure.  The summary gives you a count of all referenced and unreferenced items.  It is not affected by settings in the Items to Include section.

DETAIL

The report will include a list of all referenced and unreferenced items, by name, for each item at the level of analysis; one list per project, one per form or module, one per procedure.  The detailed list IS affected by the Items to Include option settings: only included items will be listed.

ALL INFO

The report includes both the summary and the detail list.

ALL INFO WITH CODE (Pro Version, Procedure Level Only)

The procedure information section of reports will include procedure code as well as the summary and the detail list.  Reports generated with this option set can be rather large.


Report Format Options

These report options, set on the Report Options Window, control report format.

The Organization option controls the order in which VBC assembles the file and procedure level information that it generates.

The Pagination option controls the insertion of vertical margins, page headers and form-feed characters into the report file.

The Pagination, Orientation, Font and Margins options all work together to control page composition.

See Also:

Report File Extension

External Report Viewer


Organization

The Organization report option, set on the Report Options Window, is relevant only if you are generating both form/module and procedure level information.

If so, as VBC runs, it generates two temporary report files for each form and module in the project.  One has file level info, the other procedure level info.  At the end, VBC merges these files into a final report.  This option controls the order in which it does so.

This option has 2 settings, as follows, with the results described:

HIERARCHIC

The report is assembled by file, with file level info followed by procedure level info:

Project Level Info

File 1 File Level Info

File 1 Proc Level Info

File 2 File Level Info

File 2 Proc Level Info

etc.

LATERAL

The report is assembled by level, with all file level info followed by all proc level info:

Project Level Info

File 1 File Level Info

File 2 File Level Info

File 3 File Level Info

File 1 Proc Level Info

File 2 Proc Level Info

File 3 Proc Level Info

etc.


Report Page Composition

VBC's Pagination, Orientation, Font and Margin options all work together to control page composition  (Since VBC's reports are ASCII text files written to the Report Directory, what these options really do is control the file format).

Page composition is a sequence of calculations based on the current Windows printer driver and executed whenever you change one of these options.  The sequence is as follows:

1) VBC queries the printer driver about current page size, printable size (many printers have a fixed minimum margin), and available fixed-pitch fonts.  Any minimum margins found become the lower limit for the Margin settings, and if the previous margins were less than the minimum allowed they are adjusted upwards.

2) VBC uses the Font Name and Font Size settings to determine character rows and columns per inch, and then uses the Orientation setting to translate these into total rows and columns per page.  If Orientation is set to Portrait, rows run across the smaller page dimension; if set to Landscape, they run across the larger dimension.  Note that VBC's font choices are limited to fixed pitch fonts available on both the printer and the screen.

3) Finally, VBC uses the Margin and Pagination settings to translate total rows and columns per page into printable rows and columns:

a) If Marginsare set above the minimum values, VBC uses the current font to translate them into the equivalent number of rows and columns.  When the report file is generated, all non-blank lines will begin with n spaces, where n is the number of margin columns so derived from the L/R Margin.  The T/B Margin only has an effect if Pagination is set to Yes.

b) If Pagination is set to Yes, VBC sets aside 4 rows per page for a header and however many blank rows are needed to make up the top margin.  When the report file is generated, VBC will begin each page with these blank margin rows and the header, and end each page by inserting a form feed (ASCII 12) when the lower margin is reached.  If you intend to use VBC's internal report viewing and printing utility, however, we recommend that you leave Pagination set to NO and let VBC handle it  when you want to print.  See the separate discussion of Pagination for more information.

If you are using VBC's internal report viewer, when VBC generates the report file it includes a header with the settings of these options for the viewer's own use.  See the discussion of VBC's Report Viewing & Printing Utility for more information.


Report Pagination

The Pagination report option, set on the Report Option window, determines whether or not VBC inserts vertical margins, page headers, and form feed characters when it generates report files.  See the discussion of Page Composition for details.

Setting this option to Yes is not the only nor the best way to print paginated reports, however.

If you are using VBC's internal Report Viewer & Printer, we recommend that you leave Pagination set to NO, the default.  This way, you don't have to scroll through page headers and vertical margins in the viewer, and when you tell VBC to print, it will paginate on the fly for the current font.


Report File Extension

The Report File Extension option, set on the Report Options Window, sets the extension that VBC uses when it creates report files.  This is set to TXT by default, but you can override it if you want a more distinctive name or one that associates the files with other text editing or viewing programs in your development environment.


External Report Viewer

VBC has a built-in program for viewing, searching, and printing the analytical reports that it creates.  Since these reports are just ASCII text files, however, there is no reason why they can't be loaded into any file viewer or text editor that  loads a file specified on the command line.

If you would prefer to override VBC's internal viewer with one more to your liking, simply enter its name (and path, if necessary) in this text box and VBC will use it instead.

Note:  VBC reports are often too large to load into the Windows Notepad.

See Also:

The Report Viewing and Printing Utility


Items to Include in Reports

The Items to Include report options, set on the Report Options Window, determine the contents of any Detail Level report sections that you have configured VBC to generate.  They work in conjunction with Ref/Unref Info report options.  You can set them individually, or all together by clicking the Set All control.

There are 4 possible settings for each item at each level of scope, as follows:

REF & UNREF

All items with the given type and scope are included.

REF ONLY or UNREF ONLY

Only referenced or unreferenced items with the given type and scope are included.

NONE

No items of the given type and scope are included.

See Also: Special Considerations When Including Local Items


Special Considerations When Including Local Items

Beginning with version 3.01, VBC can include much more information about local items in its reports.  If you request any such information by setting the corresponding report options, there are a few things to keep in mind.

1) Requesting local information makes VBC do considerably more work.  Although the  additional work will be barely noticeable on small projects, it will definitely be noticeable on large ones.  This is because when you request local information, VBC must build a temporary local information database and then search it repeatedly as it constructs the report.

2) If you have a large project and instruct VBC to report referenced local items, it may generate an ENORMOUS report file.  Consider yourself warned.

3) There are four kinds of items that exist only at the local level, with no analog at the form/module or global level of scope: arguments, implicit variables, literals (string and numeric), and labels.  Furthermore, some of these items make no sense to the referenced / unreferenced logic of VBC; there is no such thing as an unreferenced implicit variable or literal.  In light of this, and to avoid cluttering up the report options window any further, VBC does not offer explicit options to control the display of arguments, implicit variables, or literals.  They are controlled, instead, as follows:

Arguments are treated as local variables.  If you request a report on unreferenced local variables, you will also get unreferenced arguments.  If you request referenced local variables, you will also get referenced arguments.  Etc.

Implicit variables are treated as REFERENCED local variables, ie they will be reported if you have requested the reporting of either Ref Only or Ref & Unref local variables.

String and Numeric literals are treated as REFERENCED local constants, ie they will be reported if you have requested the reporting of either Ref Only or Ref & Unref local constants.


Status Window Information

Information presented in the Status Window tells you precisely what VBC is doing at any given time

Action tells you what step in the processing cycle is executing.

File tells you what file is being processed.

Routine tells you what routine or item within the file is being processed.

The upper graphic shows either pistons or a sliding bar indicating percentage completion of the current operation.  The actual percentage is shown to the right.

The lower graphic shows pistons indicating percentage completion of all operations: it hits 100% when the project is fully optimized.

The remaining indicators show the amount, in KB,  of memory and disk space available and in use, and the time elapsed since optimization began.

See Also:

Status Window Updating (Pro Only)


Main Window

VBC's Main Window provides an uncluttered command post for optimizing projects.

Whenever you resize the main window, the controls on it resize as well.  This lets you size the window to your preference yet retain full functionality.  Window size and position are retained on exit and restored on entry.  The window resets to default dimensions when you double click it.

Click any main window control for more information

Compress Menu

File Menu

Help Menu

Main Window Commands

Project Directory

Project Lists

Project Information

VBC Project / Report


Process Options Window

The Process Options Window, accessed from the File Menu on the Main Window, allows you to view and change process options that control the behavior of VBC as it optimizes your project.

To change option settings using a mouse, click the left button on an option to move forward in the list of possible settings.  Click right to move backward in the list.

To change option settings using the keyboard, select the option using the tab key and change it using the space bar.  The shift key reverses movement.  You may also use the N(ext) and F(orward) keys to move forward in the  list of options, and P(revious) and B(ack) to move backward.

For information on specific options:

Global Process Options

Code Process Options

Unreferenced Item Processing


Report Options Window

The Report Options Window, accessed from the File Menu on the Main Window, allows you to view and change options that control the output  and analysis VBC generates as it optimizes your project.

To change option settings using a mouse, click the left button on an option to move forward in the list of possible settings.  Click right to move backward in the list.

To change option settings using the keyboard, select the option using the tab key and change it using the space bar.  The shift key reverses movement.  You may also use the N(ext) and F(orward) keys to move forward in the list of options, and P(revious) and B(ack) to move backward.

Report Options are divided into three categories.

Sections to Generate Options control report content at a high level.

Items to Include Options control report content at a finer level.

Format Options control report format.

Click any option for which you'd like more information:

Sections to Generate

VBC Configuration Info

Project File Info

Code by Category

Ref / Unref Info

Items to Include

Items to Include

Format Options

Organization

Pagination

Page Composition

Other Options

Report File Extension

External Report Viewer


Program Options Window

The Program Options Window, accessed from the File Menu on the Main Window, allows you to view and change options that control the behavior of VBC as it optimizes your project.

Click any option for which you'd like more information:

Binary Project Files

Interaction with VB

Retain Optimized Code

Beep On Error

Error Logging

Grey Display

Status Window Updating  (Pro Only)

Help System Interaction


Status Window

The Status Window, visible whenever VBC is working on a project, informs you of current processing status.

Note: Although the Status Window does not have a title bar, you can still drag it around the screen.  Unless VBC is idling, though, it may take a few seconds to respond, so don't overshoot.

For more information:

Status Window Commands

Status Window Information

Status Window Updating (Pro Only)

The Processing Cycle


Working Directories Window

The Working Directories Window, accessed from the main file menu, allows you to specify where VBC should write different kinds of output, as well as where to find VB.EXE if it is not in your path.

Working directories include:

Scratch Directory

New Project directory

EXE Directory

Report Directory

VB Directory.

You may set directories either by typing directly into the textboxes, or by point and click.

Note: The project, new project, and scratch directories must all be different, to prevent any possibility of overwriting original code.

See Also:

Files Created by VB Compress


Set Project Directory Window

The Set Project Directory Window pops up whenever you click the directory icon on the main window, and allows you to set directories by point and click.

A single click on the drive window and a double click on the directory window changes the calling directory.

Note: If you resize the window vertically, the directory list will resize as well.


Reserved Word List Window

The Reserved Word List Window, accessed from the File Menu on the Main Window, allows you to view and/or change your list of reserved words.

For More Information:

The Reserved Word List

Reserved Word List Window Commands

Reserved Word List File


Debug Statement List Window Pro Only
Debug Statement List Window (Pro Only)

The Debug Statement List Window, accessed from the File Menu on the Main Window, allows you to view and or change your list of standard debug statements.

For More Information:

Debug Statement Handling

Debug Statement List

Debug Statement List Window Commands


Set Default Data Type Window

The Set Default Data Type Window allows you to specify default data typing for consolidated files created when VBC is instructed to Make 1 Global or Make 1 Module.

This window pops up automatically during processing under one of two circumstances:

1) You have set Default Data Types to SET@RUN, or

2) You have set Default Data Types to AS_IS, but default data types do not match across the files being consolidated.

In either case, the window shows you the data types on all files to be consolidated and allows you to specify the default data typing to use in the consolidated file.

Note:  VBC performs rudimentary checking on the types you specify, but will allow you to input some combinations that VB considers illegal.  The onus is mostly on you to enter legal specifications.

See Also:

Default Data Types

Global Consolidation Errors

Module Consolidation Errors


Consolidation Problem Window

The Consolidation Problem Window pops up at runtime if:

1) You have configured VBC to consolidate project files (globals, modules, or both), and

2) VBC anticipates that the consolidation is likely to create a problem.

The window explains the anticipated problem and allows you to decide what to do next.

Note:  This window, relabeled as "Opportunity" instead of "Problem," also pops up if module consolidation is off and VBC concludes that turning it on could be beneficial.

See Also:

Default Data Types

Global Consolidation Errors

Module Consolidation Errors


The Report Viewing & Printing Utility

VBC now includes a specialized internal utility for viewing and printing the report files that it generates.  This utility can be used to view and print any ASCII text file, but it has some special capabilities when used with VBC reports.

Click the topic for which you would like more information:

Opening and Viewing Report Files

Searching Reports

Viewer Fonts

Paginating and Printing Reports

See Also:

Report Options


Opening and Viewing Reports

VBC opens a report file for viewing when

a) it finishes processing a project and you anwer Yes to the View the Report? query;

b) you select File/Open from the Viewer menu;

c) you select View Info on VBC's main window, or double-click a report file name.

When VBC opens an ASCII file for viewing, the first thing it does is check for a report header and act on it if there is a one.  Then it loads the file, displaying progress on the status bar at the bottom of the window.

VBC can handle files of unlimited length (well, we've tested it up to 6MB, which is a heck of a lot bigger than any report file you're likely to generate).  It does so, however, in "extents" of 32K lines apiece.  If the file you load has more than 32K lines, you will notice that the vertical scroll bar splits into two.  The upper bar now controls scrolling through the current extent, and the lower bar switches between extents.


Searching Reports

VBC report searching capabilities, accessed from the search menu or via hot keys, are pretty standard and self-explanatory.  You can search up or down, repeat the last search, and go to a given line.

VBC also gives you the ability to search for the next and previous section of reports.  Report file sections are demarcated by the section symbol (ASCII 167).


Viewer Fonts

You can set the font name and size in which to view and print reports by selecting Fonts on the viewer's menu bar.  To ensure both true WYSIWYG performance and even alignment, your choices are limited to fixed pitch fonts available on both the printer and the screen.

If the report you are viewing has a header, the viewer set its current font to the one specified when the report was loaded.  This font is the one VBC used to compose, and if you change it within the viewer, the report may need to be reformatted before printing.

Note: VBC has a single report font setting; changing it in the viewer also changes it as a report format option, meaning that the next report VBC generates will be formatted for whatever font was last selected in either place.


Paginating and Printing Reports

You can instruct VBC to print the report file you are viewing by selecting File/Print... from the viewer's menu bar.

Before printing, VBC checks to see if the report is properly paginated for the current printer & font combination.  If VBC's pagination report format option was set to Yes when the report was generated (i.e. you can see vertical margins and page headers in the viewer), and if you have not changed the current printer or the font, then pagination should be OK and VBC will pop up a standard print dialog box.

If the report  file is not pre-paginated, however, or if the current printer & font combination yield a different number of lines per page than were assumed when the report file was generated (see page composition), VBC will first ask if you want to repaginate on the fly.  If you say Yes, VBC will refigure the page count before popping up the print box, and will dynamically repaginate as it sends the report to the printer.

Note: VBC's on-the-fly reformatting capabilities are limited to vertical formatting; if you select a larger font than was assumed when the report file was written, printed pages will have the right number of lines on them, but these lines are likely to disappear off the right side of the page.


Report Header

When VBC opens an ASCII file for viewing, the first thing it does is check to see if the first two lines are a format header inserted when VBC created the file (see page composition).  The header looks something like this:

[VBC Viewer Info]

0,0,"Lucida Sans Typewriter",9.75,53

The first entry is orientation (portrait=0, landscape=1) and the second is pagination (No=0, Yes=1).  The third and fourth specify font name and size, and the final entry is printable lines per page.

If the report has a header, VBC acts on the font and orientation info immediately, setting the viewer screen font as specified and sending a GETSETPAPERORIENT escape command to the printer driver.  The other info in the header is not acted on until and unless you print.


The VB Error Window

The VB Error Window appears on your screen if VB has trouble with the optimized code that VBC has just generated and instructed VB to load and compile.  The window describes the error, the line of code, and the token that VB highlighted while reporting it (if error logging is active, this information is also logged to disk).  The window also asks you to decide what to do next:

Attempt to Continue

VBC ignores the error and attempts to continue.  Unless the error is an old file format alert  or other innocuous load-time message, however,  VB is apt to continue reporting the error and VBC will pop the window up again.

Abort VB

VBC gives up, shuts down VB, completes processing any report you have selected, and returns to ready state.

Take Control of VB

VBC pops up the VB Control Window, drops into the background, and waits for you to either exit VB manually or reactivate VBC via the VB Control window.

Help

VBC starts help at this topic.

See Also:

Troubleshooting


Troubleshooting

VBC does extensive checking and rechecking to prevent errors from creeping into the optimized code that it generates.  It is not entirely foolproof, however, because some of the processing options can be set in ways that interact with original code and generate new code that VB is unable to either load or compile.  Should you get an error, please consult this section carefully before calling technical support.

Assuming that your original code loads and compiles without problem, the secret of successful troubleshooting is to figure out which option settings are causing problems and reset them accordingly.  This section outlines the kinds of errors that can occur and the option settings most likely to cause them.  Click the item for which you'd like more information.

General Error Type

Disk and File Errors

Global Consolidation Errors

Missed Reference / Omitted Code Errors

Module Consolidation Errors

Out of Memory Errors

Specific Error Messages

Disk full...

Duplicate definition

Duplicate label

Expected...

Expression not allowed here

Out of Memory - too much code in procedure...

Out of Memory - too much form/mod-level code in...

Out of String Space

Parameter type mismatch

Reference to undefined function or array

Syntax error

Too many files

Type mismatch

Type not defined

Variable not defined

Options that can generate Errors

Check Reserved Words

Event Procedure ID Method

Make 1 Global

Make 1 Module

Reorder Declares

Unreferenced Item Processing


Global Consolidation Errors

There are three circumstances in which consolidation of all project globals into a single file can cause problems.  Two problems are easily fixed.

1: Default Data Type Conflicts

If the files from which globals are consolidated have different default data types, you get a potential data typing problem which you or VBC will need to correct on the fly.  See the discussion of Default Data Types for more information.

2: Out of Order Dependencies

VB allows you to define globals in any module file, and resolves dependencies between globals defined in different files.  For example, you can define "global const gc1 = 1" in GLOBAL.BAS, and "global const gc2 = gc1 + 10" in AGLOBAL.BAS.  VB will have no problem with this, even though AGLOBAL.BAS appears first in the alphabetical project list.

If VBC's Reorder Declarations option is turned off, VB will have a problem, however,  with the consolidated global file that VBC creates from this code.  If this option is off, VBC consolidates globals in the order in which it reads project files, the same alphabetic order in which they appear on the project list.  This can sometimes result in out of order dependencies, as in this case where gc2 would be defined before gc1.  Similar problems can occur across types, such as when a global variable is dimensioned with a constant and/or as a user-defined type that ends up below it in the consolidated file, or when API function declarations have user-defined types as arguments.  Out of order dependencies usually result in "Type not defined", "Improper constant declaration", "Variable not defined", or "Expression not allowed here" error messages from VB.

The hard way to fix these problems, which becomes evident when Make EXE fails, is to shuffle stuff around in the consolidated global.  The easy way  is to turn on Reorder Declarations.

3: Scope Conflicts

If your code defines a global identifier using a module identifier, eg "const ModCon=4: global const GloCon = ModCon +4",  or "dim GloVar(ModCon)", the Make 1 Global Option is almost guaranteed to create a problem:  it's going to move the global definition statement into a new file and leave the module definition statement behind.  The only time it won't fail is if Make 1 Module is also ON, Reorder Declares is OFF, and the Gods are smiling.

Pardon the editorial, but defining a global with a lower-scoped item is lousy programming practice.  If you insist on doing it, either leave global consolidation OFF or fix the problem at Make EXE time.


Module Consolidation Errors

There are four circumstances in which consolidating module files can generate errors.  Two have to do with the module-level declarations, the third with various other matching identifiers.

1: The module files have different data type defaults, e.g. the declaration section of one starts with "DefInt A-Z", while another starts with "DefSng A-Z,"  or has no default (which means Variant).  If you combine the routines from these modules into a single new one, the resulting project may:

a) fail to make an EXE, bombing with "Type Mismatch" errors;

b) if it does make an EXE, the EXE may not run; and

c) if the EXE does run, it will probably not run correctly.

If you follow the good practice of always defaulting to integers, this problem does not arise.  If it does, VBC anticipates it at run time and gives you a change to correct or avoid it by popping up the Set Default Data Types Window.

For more information, see the discussion of Default Data Types

2: The module files have module-level variables and/or constants with the same name, e.g. two modules each have "Dim ModVariable" or "Const ModConst = -2" in their declarations section.  Since the declaration sections will be combined, the resulting single module will fail to make an EXE, due to a "Duplicate Definition" error.

If you have this problem, you might consider revising your original code:

a) If the names are the same because they actually do refer to the same constant or variable, the routines probably belong together in a single module anyway, in which case you can merge them (remember that VBC will prevent unused procedures from creeping into your EXE).

b) If the names refer to different  constants or variables, they probably shouldn't match to begin with.  If you perform a global search and replace in the original module file(s), using different names, the problem will go away and you can leave the option checked.

3: The module files have other matching identifiers. Assorted other identifiers with the same names can exist happily in different modules, but cause conflicts when contained within a single module; labels, for instance.  Since these identifiers can be sprinkled throughout the module, it is much harder to check for conflicts in advance, as VBC does with the contents of the declarations section.  Should these conflicts make themselves known at Make EXE time, your only choice is to fix them manually or shut off consolidation and try again.

4: The module files have different VB option setting, i.e.  Option Explicit, Option Compare, or Option Base.  Combining modules that have different settings for these options can generate a variety of problems.  The most obvious problem occurs when one module has Option Explicit and another does not, which will lead to "Variable not defined" errors if there are any implicit variables (VBC will include the first instance of any option statement found in any module into the consolidated module).  Errors arising from Option Base or Option Compare will be harder to find, however, because they will not occur until runtime.

For more information, see the discussion of Duplicate Definition Errors


A Note on Embedded Double Quotes

VB supports but does not document the use of doubled double quotes to insert double quotes  (chr$(34)) into string literals.

VB Compress also tries to support this syntax, but there are so many different possible combinations of single, double, triple, and quadruple double quotes that VBC's parsing logic may fail under certain circumstances.  We have tried to accomodate every combination we can think of, but if past experience is any guide, somebody out there has written code that is going to choke VB Compress.

If VBC goes into an infinite loop or generates an "out of string space" error while analyzing a procedure, chances are very good that this is the problem.  To confirm it, note the procedure that was being analyzed and locate the line of code causing the problem.

The quick fix is to rewrite the line using the documented syntax of "chr$(34)" instead of """""

If you fax us the offending line of code at (617) 241-8496, however, we will try to modify the parsing logic to work properly and send you an update.

Note: With the release of VBC 3.0, we believe we have a 100% robust parsing procedure that deals with any combination of embedded double quotes, and almost removed this topic from the help file.  Why tempt fate, though?


Out of String Space Errors

An "Out of String Space" error during the compression process indicates that VB Compress blew up while parsing a line of code.  In every known case where this error has occurred, the line in question used pairs or triplets of double quotation marks to insert a double quotation mark into a string.

This  is undocumented  language syntax, and while VBC does its best to interpret it, a) it can be confused by certain combinations of double quotes, b) we haven't quite figured out how to fix it, and c) since it is undocumented, we don't feel too bad about it (although we're working on the problem).

The fix is for you to change your source code to use the documented Chr$(34) syntax to embed double quotes in strings.


Duplicate Definition Errors

A "Duplicate definition" error at Make EXE time indicates that a consolidated module file contains matching identifiers that caused no problem when contained in separate files.  VBC anticipates and warns you about this problem when the identifiers are module-level variables or constants, but does not detect other matches that can be scattered throughout code.  Matching labels are a primary example, but there can be others: declared API functions might match a local variable, etc.

Should you get this error, your choice is to manually rename items or shut off module consolidation.


Reference to undefined function or array errors

A "Reference to Undefined Function or Array Error" at MAKE EXE time indicates that VBC has failed to recognize calls to a sub or function procedure, has thus identified it as unreferenced, and has removed it from the project.  The recognition failure probably occurred because the call is nested as an argument to another procedure and, for one of a variety of reasons, VBC has decided to ignore it.

We are identifying and eliminating the reasons for recognition failure, and VBC 2.x ships with all known reasons fixed.  Should this happen, please notify tech support.  Meanwhile, the quick fix is to make the call more explicit by setting an intermediate variable as follows:

Original

Foo$ = Format$(WinVer(), "##.00")

Fix

WV = WinVer()

Foo$ = Format$(WV, "##.00")


Out of Memory Errors

There are two options that can lead VBC to generate code that causes VB to report "out of memory" errors.

1) If you get an "Out of memory - too much code in procedure" message, the problem is most likely that you have unreferenced item Processing options set to Comment Out or Leave and Mark.   These settings increase the size of procedure code because they add text to unreferenced items, and if the procedure was pushing VB's 64K limit to begin with, the added text can push it over the edge.  To fix the problem, reset the options to Remove or Ignore.

2) If you get an "Out of memory - too much form/mod - level code" message, the problem can be caused by the option just discussed (try loading WINAPI30.TXT and using Comment Out, for example).  You can also get the problem if 1) you have a very large project, 2) you have the pro version and are using substring matching, and 3) you have the parameters set to match lots of strings (i.e., minimum length and minimum repetition are set low).  Under these circumstances, VBC may generate a VCC file bigger than 64K, too big for VB to load.  To fix the problem, increase the parameter settings.

See Also: The /CPB Switch


Missed Reference / Omitted Code errors

Under certain rare circumstances, VBC may miss a reference to an item in your original code and consequently omit the item from the optimized version that it generates.  At the time this help file is being written, the only known causes of such omissions are 1) setting event procedure id method to CTRL_EVENT without updating the reserved word list for custom controls, or 2) processing code that uses items on the reserved word list as identifier names with the Check Reserved Words option set to No.

Omitted code can cause VB to report a variety of different error messages: "Reference to undefined function or array ", "Syntax error," "Expected...", "Type mismatch", "Type not defined", etc.  You should be able to figure out what's missing by rerunning VBC with unreferenced item Processing set to Comment Out and looking for green stuff that ought to be black.

If you have such a problem and it won't go away with reserved word checking active, please report it to technical support.


Disk and File Errors

Most disk and file errors reported by VB or VBC are pretty obvious: "Disk full" means just that, that you have run out of room on the drive you have told VBC to write to, or on the drive pointed to by the Windows "temp" variable, used by VB.  If you have this problem, make some room or use a different drive.

One error message however -- "Too Many Files" -- is bit confusing, because you can get it even when a disk has plenty of room on it.  You are apt to get this message if you are using a ram drive and compressing a medium-to-large project.  You get it because 1) VBC creates up to 5 temporary files on the scratch drive for every file in the project it is optimizing, 2) because the RAMDRIVE device driver defaults to 64 file handles unless you specify otherwise, and hence 3) you can run out of file handles even though there is plenty of space left.  To fix this problem, see your DOS documentation and edit  the RAMDRIVE entry in CONFIG.SYS to increase the maximum number of file handles.


Questions & Answers

This topic includes questions and anwers to the most frequently asked and/or most interesting questions fielded by Tech Support.

How can I make VBC run faster?

The time it takes VBC to run depends on the quality of your hardware, the size of your project, and the options you have selected, roughly in that order.  Like any Windows app, it is very sensitive to memory and disk speed and will benefit accordingly from ample RAM, disk caching, and speedy, defragged hard disks.  Any machine that you find adequate for VB development, however, is apt to deliver satisfactory performance with VBC  as well.

Assuming that project size is a given, the cheap way to speed things up is to make sure that you aren't asking VBC to do any unnecessary work or perform any unnecessary checks:

1) Don't ask VBC to report information that you don't care about.  Each bit of information requested means more work and more time.  This is particularly true for local item reporting; if you request no local info, two-thirds of the code in VBC's core analytical routine never executes.

2) If you've already run an analysis and now want to compress, shut off reporting completely by selecting the "No Info" report option (you might want to add a little back by setting Project File Info to Both; then you know the results, and the additional time taken is negligible).

3) If you have the Pro version, set Status Window Updating to Minimal.

4) Leave all the fancy options off: no assertion, debug code searching, substring matching, global or module consolidation, etc.  All of these steps take time.

5) Set Unreferenced Item Processing to Remove for all items at all levels of scope; Marking or Commenting takes time.

6) If you don't intend to keep the optimized source code, set Line Spacing to Single and Comments to Remove.  If you do, blank lines and comments are discarded up front and never processed.  If you do not, each line is loaded, processed, and content-checked several times.

7) Read the discussion of the Check Reserved Words option, and if you know your code well enough to know that it won't cause a problem, set it to NO.

8) Store your projects in ASCII format so that VBC doesn't need to make ASCII copies of them (you should do this anyway for reliability reasons; always "Save as Text").

Why does VBC insist that VB be shut down before it starts?

There are two reasons:

1) VBC controls VB in a way that our friends at Microsoft never intended for VB to be controlled (after all, VB doesn't support DDE or OLE, now, does it?).  VBC does this by launching VB, keeping scrupulous track of all windows that belong to it, and monitoring their contents.  This is how it later intercepts error messages and does other tricky things.

2) The whole point of VBC is to create the tightest EXE's possible.  The current version of VB is certainly much improved over earlier versions in this regard, but it can still get cluttered over time and insert unnecessary junk.  The only way to insure that there is no junk is to start a clean copy.

Relatedly: Why, when VBC starts VB, does it start it first, then load the project second?

Basically for the same reasons just discussed.  VBC starts VB without using the command line to load code so that it knows VB will start and sit there with a stable list of windows and no error messages.  When VBC then loads the project, it can identify and intercept problems.

This behavior is a pain for users who keep a big autoload.mak file.  Sorry, but until VB supports DDE I know of no other way around it.  And don't hold your breath.

VBC produced a slightly larger EXE, not a smaller one! What gives?

VBC's basic function is to identify and remove unreferenced items.  If it doesn't find many, it can't really do much.  On the other hand, it can increase code size if you have the Pro version and set the substring matching parameters inappropriately.

Also, VBC insists on working with (and compiling from) ASCII code files.  If your project is binary, VBC makes ASCII copies, optimizes them, and compiles from them.  If the bulk of your project consists of binary data (bitmaps), VB itself imposes a small amount of overhead for compiling from ASCII files.  You can get around it, though:

1) Set the Interaction with VB option to None

2) Set the Retain Optimized Code option to Yes

3) Run Compress

4) Convert the optimized code to binary:

a) Select the project on the VBC Project List

b) Select Binary Save on the Compress Menu

4) With the optimized project still selected on the VBC project list, select Compile from the Compress menu.

Voila!

Why doesn't VBC remove unused VBX files from my project?

Not because we haven't thought of it!  Enough users have requested this capability to put it near the top of our wish list.  Unfortunately, we haven't come up with a reliable way to do so.  The problem is that the VBGetModelInfo function, which is the only way to get control class information without actually loading and registering the control, is optional and most VBX's don't support it (see p.274 in the control development guide).  We have considered alternate ways to ID unused VBX files, but everything we've thought of so far is too kludgy or unreliable to distribute in a serious product.  We'll keep working on it, though.

Why the name change from Tailored PC's to WhippleWare?

A guy named Ben Whipple (that's me) created VB Compress to help write and manage a large VB project that was part of his dissertation at MIT.  His wife advised him to market it, and he used the name of his long-standing on-the-side consulting business, Tailored PC's.  This name did a good job of describing what Ben used to do (set PCs up for people), but a lousy job describing the new endeavor.  Now that it's a going concern, Ben wants his name on it, and besides, WhippleWare is more fun to say.  For those of you old enough to remember Mr Whipple and the Charmin commercials, we like to say that VB Compress is squeezably soft-ware.


What's New in VBC 3.01?

We are pleased to begin 1994 with a new release, VB Compress 3.01.  This is our first update since we released 3.0 in 9/93.  As you might expect from the version number, it includes minor bug fixes.  As you might not expect, however, it also includes a few significant enhancements.

NEW FEATURES

The most significant enhancement is VBC's new capability to remove unreferenced LOCAL items as it optimizes code.  You will see new Process Options to control this capability.  Check out the Special Considerations When Processing Unreferenced Local Items topic for more info.

You will also find VBC's reporting capabilities improved, again especially with regards to LOCAL items.  VBC now does a much more thorough job of documenting the local identifiers in your code, and reporting them at the project, file, and procedure level.  Check out the Special Considerations When Including Local Items topic for more info.

Other enhancements to VBC's reports include:

At the Project and File Levels:

VBC now reports the library names for all API/DLL subs and functions.

At the File Level:

VBC now reports the default data typing for all project files.

VBC now reports the VB option settings for all project files (Option Base, Compare, and Explicit)

At the Procedure Level:

VBC now reports the data type for all functions, notes those not specified (search the report for "not specified"), and shows the file-level defaults they assume.

VBC now reports whether or not a procedure has error handling code.

MULTI-USER CHANGES

VBC is now available in both single and multi-user versions.  The number of licenses for simultaneous use is visible in the lower left corner of the About Box.  If you have a multi-user copy, VBC looks for its initialization files and logs errors in the local Windows directory, rather than the directory where it is installed.  The name of the error log has been changed (in both versions) from ERROR.LOG to VBCERROR.LOG to prevent confusion.

BUG FIXES

Thanks to extensive pre-release testing, very few bugs were ever reported in VBC 3.0.   Only one was really serious (ie, a GPF), and it was reported by only two users, both working on genuinely enormous projects.  In VBC 3.01 every bug reported and a few we found ourselves have been squashed.

The serious though rare bug was a GPF caused when enormous projects and bad luck pushed some internal arrays of user-defined datatypes (with variable length strings) past a segment boundary.  This problem was eliminated by padding the type to an even power of two.

The list of minor bugs fixed includes:

More accurate identification of implicit variables; VBC is no longer confused by database objects, elements in arrays of user-defined types, or the BF options for the Line method.

No longer misses references to user typedefs defined with same name as constants or variables at any level of scope.

Now correctly id's ME and ACTIVEFORM as form references, ACTIVECONTROL as a control reference.

"Empty" added to the reserved word list.

Bug fixed in procedure count; proc count per file reports now always accurate.

Clicking OK no longer generates error in Debug Statement Window if no file name specified.

F1 key now calls help from Option windows.

Reorder Declares option now reorders (and annotates) consolidated file headers to avoid out-of-order dependency problems caused by consolidation.

Viewer window now has minimum size, no longer crashes if made too small.

Repeated "Ignore" on Errors no longer causes "Bad File" Error.

Substring matching: No longer processes comments.

No longer need to restart Windows to start VBC after improper shutdown.

January 31, 1994 Release

Fixed "Illegal function call" caused when VBC parsed local declaration of variable named "D"

Changed internal test for existence of a directory to work with Windows NT

Fixed declaration parsing problem when trailing comment had same tokens as declaration

April 1994 Release:

Fixed indenting problem when user had reset the tabstop environment variable (embedded tabs now always replaced with 8 spaces)

Fixed LoadRoutines overflow problem when blank lines encountered in huge procedures

Fixed missed references to local vars when preceded on line by type element of same name.

Changed to permit "Sub" or "Function" as type elements.

I would like to extend special thanks to all users who took the time to call Tech Support, report these problems, and help me track them down.

Thanks for buying VB Compress!

Ben Whipple


Positioning the Help Window

VB Compress can control the size and location of  its Help window.  The Help System Interaction options, set on the Program Options window accessed from the file menu, determine whether and how it does so.

If Position Help Window is checked, help requests are packaged with resizing messages that fit the Help window between the edge of the screen and the edge of the calling window.

If Slide Calling Window to Left is checked, the calling window is moved to the left edge of the screen before help is requested, and the Help window  is placed to its right.  If not checked, the calling window is not moved and Help will be placed on whichever side is furthest from the edge of the screen.

If the width available is less than the value you set for Minimum Help Window Width, expressed as a percentage of total screen width, the Help window will be sized to this minimum.

If Position Help Window is not checked, the current size and position of the help window is not changed and the other options have no effect.


About Documentation

Hey WhippleWare!  Where's the #*&#?! manual?

There isn't one.  Why not?  Because we want to provide the most accessible, up-to-date, and generally most useful documentation possible, and we don't think that hardcopy measures up.  Instead of writing shelfware, we've put considerable effort into creating an online help system that we believe is superior to hard copy in all respects.  OK, all but one; it's harder to read in the bathroom.

Beyond the usual good stuff (you'll find it comprehensive and very context-sensitive), the help system is managed by VB Compress to co-operate onscreen, obscuring as little as possible so that items of interest and information about them are visible simultaneously.  See Positioning Help for details.

You will work most productively with VB Compress by first familiarizing yourself with the operation and contents of the help system.  We are pleased to provide support to any customer who has consulted help and still cannot answer their question or solve their problem (see Technical Support).  But we might get a little testy with folks who call and obviously haven't checked help.

Don't look for a README file, because the documentation is 100% up to date.  But hardcore hardcopy fans will find VBCOMP.WRI, a Windows Write file with the contents of the help system.


Configuring the VB Control Interface

VBC controls and interacts with VB.  Because VB was not designed to be controlled (by DDE, for example), we have implemented this capability  -- call it the VB Control Interface -- as a combination of WinAPI calls and SendKeys.  The VB Control Interface is configured by settings in the [VBKeys] section of the INI file.

If you are using a non-English version of VB or Windows, you need to reconfigure the VB Control Interface.  If you do not, VBC will look for the wrong windows, send improper keystrokes, and generally beep and make a mess instead of controlling VB.  You need to manually edit the [VBKeys] section and replace the default English values with those needed for your system.

Each entry in [VBKeys], listed below, defines a window or control caption or a keystroke sequence in standard SendKeys format.  Click them for details.

AppName=Microsoft Visual Basic

LoadProjectName=%FO%N

SaveTextName=%FT%N

SaveFileAsName=%FA%N

SaveAsText_CID=4216

RestoreMin=% R

TopOfProjWin%WR{HOME}

LoadTextName=%FL%N

Replace=%R

OpenCodeWindow={F7}

CloseCodeWindow=%-C

MakeExeWindow=%FK

MakeExeName=%N

VBExit=%FX

MinimizeWin=% N

DialogYes=Y

DialogNo=N

SaveAsTextCaption=Save As Text

SaveFileWinTitle=Save File As


AppName=Microsoft Visual Basic

The "AppName" VB Control Interface key defines VB's application title, ie the string that appears on the task list and that you would use with the "AppActivate" procedure .

The default English sequence is "Microsoft Visual Basic"


LoadProjectName=%FO%N

The "LoadProjectName" VB Control Interface key defines the keystrokes to send to have VB load a project.  After receiving this sequence, VB should be ready to receive "projectname~".

The default English sequence is "%FO%N"


SaveTextName=%FT%N

The "SaveTextName" VB Control Interface key defines the keystrokes to send to have VB save the text of a file.  After receiving this sequence, VB should be ready to receive "filename~".

The default English sequence is "%FT%N"


SaveFileAsName=%FA%N

The "SaveFileAsName" VB Control Interface key defines the keystrokes to send to have VB save a file with a new name.  After receiving this sequence, VB should be ready to receive "filename~".

The default English sequence is "%FA%N"


SaveAsText_CID=4216

The "SaveAsText_CID" VB Control Interface key is the dialog ID of the Save As Text checkbox on VB's "Save File As" window.  You shouldn't have to screw around with this.

The default English value is "4216"


RestoreMin=% R

The "RestoreMin" VB Control Interface key defines the keystrokes to send to a minimized window to restore it.

The default English sequence is "% R" (there's a space in the middle).


TopOfProjWin=%WR{HOME}

The "TopOfProjWin" VB Control Interface key defines the keystrokes to send to set the focus within VB on the project window, and to highlight the top file in the project list.

The default English sequence is "%WR{HOME}"


LoadTextName=%FL%N

The "LoadTextName" VB Control Interface key defines the keystrokes to send to have VB load text into a file.  After receiving this sequence, VB should be ready to receive "filename~".

The default English sequence is "%FL%N"


Replace=%R

The "Replace" VB Control Interface key defines the keystrokes to send to have VB replace the code in a file when loading text (this sequence is sent to the "load text" window).

The default English sequence is "%R"


OpenCodeWindow={F7}

The "OpenCodeWindow" VB Control Interface key defines the keystrokes to send to have VB open the code window for the currently selected project file.

The default English sequence is "{F7}"


CloseCodeWindow=%-C

The "CloseCodeWindow" VB Control Interface key defines the keystrokes to send to have VB close the current code window.

The default English sequence is "%-C"


MakeExeWindow=%FK

The "MakeExeWindow" VB Control Interface key defines the keystrokes to send to have VB pop up the Make EXE window.

The default English sequence is "%FK"


MakeExeName=%N

The "MakeExeName" VB Control Interface key defines the keystrokes to send to have VB set the focus to the Name box in the already open Make EXE window.

The default English sequence is "%N"


VBExit=%FX

The "VBExit" VB Control Interface key defines the keystrokes to send to close VB .

The default English sequence is "%FX"


MinimizeWin=% N

The "MinimizeWin" VB Control Interface key defines the keystrokes to send to minimize a window .

The default English sequence is "% N" (there's a space in the middle).


DialogYes=Y

The "DialogYes" VB Control Interface key defines the keystrokes to send a dialog box an affirmative response.

The default English sequence is "Y" (for Yes)


DialogNo=N

The "DialogNo" VB Control Interface key defines the keystrokes to send a dialog box an negative response.

The default English sequence is "N" (for No)


SaveAsTextCaption=Save as Text

The "SaveAsTextCaption" VB Control Interface key defines the caption of the SaveAsText checkbox that appears on VB's Save File As window .

The default English sequence is "Save as Text"


SaveFileWinTitle=Save File As

The "SaveFileWinTitle" VB Control Interface key defines the title of the window that pops up when you select "Save As" on VB's file menu.

The default English sequence is "Save File As"


About WhippleWare

In 1991, MIT student Ben Whipple used VB to write software for his doctoral research.  Ben was delighted with VB but frustrated by the time it took to make apps run efficiently.  He created VB Compress, the first and only VB optimization utility, for his own use, then decided that the software biz was more fun than academia.

VB Compress has so far received both Readers' and Editors' Choice Awards from the Visual Basic Programmer's Journal, has been recommended by speakers at VBITS and Tech-Ed conferences, and is used daily by thousands of very satisfied customers.  With his new VB Language Manager product, Ben has re-applied both his VB code-processing expertise and the  principles of doing business that made VB Compress a hit:

Our customers are not only always right, they give us our best ideas.  So when you call WhippleWare, you'll probably talk to the guy who writes the code.  And he'll listen to you.

We maintain no inventory, continually test and improve our products, and fix all problems when reported.  We don't ship software with known bugs.  Our tech support line hardly ever rings, and we want to keep it that way.

We trust our customers and unconditionally guarantee their satisfaction. None of this "unless you open the envelope" or "if it doesn't do what we say it does" nonsense.  If you aren't 100% satisfied for any reason at all, simply uninstall and return the product within 30 days and we'll refund everything except shipping and handling.  The only question we'll ask: Why weren't you satisfied?


What's New in VBC 3.11?

VB Compress Version 3.11 began shipping on 9/16/94.  This is the first (and last) version change for the year, and the first update since our 4/15/94  "slipstream" release of V3.01.  Most of the changes are under the hood, but V3.01 users will notice a few visible differences:

New Features, Refinements, & Visible Changes

The mechanics of setting directories have been changed from the quirky left-click to point/right-click to type style to standard textboxes for typing and file controls for pointing.  The main window now has a directory icon to click, and the Working Directory window has integral file controls.

The Program Options Window has been completely redone with standard controls.  The Retain Dirs and Retain Window Options have been eliminated; V3.11 always retains both.

Control of the help system has been expanded with two new options: Slide Caller to Left and Minimum Help Width.  See Positioning Help for details.

The Project Information List now includes a ballpark estimate of the time it will take VBC to process the project.

V3.11 no longer reports unused event procedure arguments as unreferenced.

The initialization file is now a standard Windows INI file in ASCII format, and has been renamed from VBCOMP3.INI to simply VBCOMP.INI (the name change prevents V3.11 from attempting to read old, binary files).

While always present, the VB Control Interface has now been exposed and documented (this is primarily of interest to users with non-English versions of VB and/or Windows).

V3.11 has been made more accommodating throughout to mouse-hating keyboard devotees, and the few instances where F1 did not call help have been fixed.  So has the unfortunate crash caused by toggling through the "Set All" option with the spacebar.

Under-the-Hood Fixes & Refinements

V3.01 was a robust product, with very few reported bugs.  However, as the user base has grown, and more importantly, as the size and diversity of users' VB projects have grown, a few problems have cropped up.  All reported problems, listed below, have been fixed.

V3.01 choked with a "subscript out of range" or "out of memory" error when processing files containing more than ~200 individual procedures.  V3.11 can handle unlimited procedures per file.

When configured to comment rather than remove unreferenced procedures, V3.01 would sometimes choke with a "subscript out of range" error when it encountered an unreferenced procedure that approached the 64K size limit.  V3.11 will not, and also has a new command line switch for dealing with commenting large procedures: see the /CPB Switch.

Relatedly, configuring V3.01 to comment out unreferenced procedures caused it to later report the wrong procedure names for local variables etc.  V3.11 gets it right.

V3.01 would report an "input past end of file error in GetRoutines" when it processed a file that ended a Sub with End Function or a Function with End Sub.  I resisted making this change, but since VB tolerates this sloppiness, so does VBC 3.11.

V3.01 would sometimes mis-identify global or file-scoped constants when used to define a local constant.  It might then compound the error by treating both as unreferenced, and omitting them. V3.11 is smarter.

V3.01 sometimes had problems with labels consisting of a single character.  V3.11 does not.

Under rare circumstances having to do with the alphabetic order of file names, V3.01 might miss dependencies in a chain of constants and/or type defs declared in different files, and omit a needed constant.  V3.11 recurses the chain until it's absolutely certain that all dependencies have been resolved.

As always, my thanks to the users who discovered these problems and took the time and trouble to help me figure them out!

Ben Whipple